From 792af116137daceaff9638976dce4ba7c8b2512b Mon Sep 17 00:00:00 2001 From: merveenoyan Date: Thu, 21 Jul 2022 19:31:15 +0200 Subject: [PATCH] added repo creation to test setups --- tests/test_repocard.py | 5 ++++- tests/test_snapshot_download.py | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/test_repocard.py b/tests/test_repocard.py index 075d309eed..49405ca22f 100644 --- a/tests/test_repocard.py +++ b/tests/test_repocard.py @@ -204,9 +204,12 @@ def setUpClass(cls): def setUp(self) -> None: self.repo_path = Path(tempfile.mkdtemp()) self.REPO_NAME = repo_name() + url = self._api.create_repo( + repo_id=f"{USER}/{self.REPO_NAME}", token=self._token + ) self.repo = Repository( self.repo_path / self.REPO_NAME, - clone_from=f"{USER}/{self.REPO_NAME}", + clone_from=url, use_auth_token=self._token, git_user="ci", git_email="ci@dummy.com", diff --git a/tests/test_snapshot_download.py b/tests/test_snapshot_download.py index 89714ad3c9..06c15ad000 100644 --- a/tests/test_snapshot_download.py +++ b/tests/test_snapshot_download.py @@ -36,9 +36,10 @@ def setUp(self) -> None: if os.path.exists(REPO_NAME): shutil.rmtree(REPO_NAME, onerror=set_write_permission_and_retry) logger.info(f"Does {REPO_NAME} exist: {os.path.exists(REPO_NAME)}") + url = self._api.create_repo(repo_id=f"{USER}/{REPO_NAME}", token=self._token) repo = Repository( REPO_NAME, - clone_from=f"{USER}/{REPO_NAME}", + clone_from=url, use_auth_token=self._token, git_user="ci", git_email="ci@dummy.com",