Update definitions_test.py

This commit is contained in:
Daniel W. Anner 2023-07-19 11:04:51 -04:00 committed by GitHub
parent f5246af5ba
commit 30cf68a804
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,13 +38,14 @@ def _get_definition_files():
def _get_diff_from_upstream():
file_list = []
temp_dir = tempfile.TemporaryDirectory()
upstream_repo = Repo.clone_from(url=NETBOX_DT_LIBRARY_URL, to_path=temp_dir.name)
repo = Repo(f"{os.path.dirname(os.path.abspath(__file__))}/../")
# repo = Repo(f"{os.path.dirname(os.path.abspath(__file__))}/../")
upstream = upstream_repo.remotes.origin
if "upstream" not in repo.remotes:
repo.create_remote("upstream", NETBOX_DT_LIBRARY_URL)
upstream = repo.remotes.upstream
upstream.fetch()
changes = upstream_repo.head.commit.diff(upstream.refs["master"].object.hexsha)
changes = repo.head.commit.diff(upstream.refs["master"].object.hexsha)
for path, schema in SCHEMAS:
# Initialize the schema