Update definitions_test.py

This commit is contained in:
Daniel W. Anner 2023-07-19 10:45:01 -04:00 committed by GitHub
parent 58c65767a1
commit b55d20c4bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,10 +38,13 @@ def _get_definition_files():
def _get_diff_from_upstream():
file_list = []
repo = Repo(f"{os.path.dirname(os.path.abspath(__file__))}/../")
upstream = repo.remotes.upstream
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__))}/../")
upstream = upstream_repo.remotes.origin
upstream.fetch()
changes = repo.head.commit.diff(upstream.refs["master"].object.hexsha)
changes = upstream_repo.head.commit.diff(upstream.refs["master"].object.hexsha)
for path, schema in SCHEMAS:
# Initialize the schema