Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
merveenoyan committed Jul 22, 2022
1 parent 17deae2 commit a82b09d
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions tests/test_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,14 @@ def test_add_commit_push_non_blocking_process_killed(self):

@retry_endpoint
def test_clone_with_endpoint(self):
repo_url = self._api.create_repo(
repo_id=f"{ENDPOINT_STAGING}/valid_org/{self.REPO_NAME}",
token=self._token,
repo_type="dataset",
)
clone = Repository(
f"{WORKING_REPO_DIR}/{self.REPO_NAME}",
clone_from=f"{ENDPOINT_STAGING}/valid_org/{self.REPO_NAME}",
clone_from=repo_url,
use_auth_token=self._token,
git_user="ci",
git_email="ci@dummy.com",
Expand Down Expand Up @@ -453,14 +458,14 @@ def test_clone_with_endpoint(self):

@retry_endpoint
def test_clone_with_repo_name_and_org(self):
self._api.create_repo(
repo_url = self._api.create_repo(
token=self._token,
repo_id=f"valid_org/{self.REPO_NAME}",
repo_type="dataset",
)
clone = Repository(
f"{WORKING_REPO_DIR}/{self.REPO_NAME}",
clone_from=f"valid_org/{self.REPO_NAME}",
clone_from=repo_url,
use_auth_token=self._token,
git_user="ci",
git_email="ci@dummy.com",
Expand Down Expand Up @@ -520,11 +525,14 @@ def test_clone_with_repo_name_and_user_namespace(self):

@retry_endpoint
def test_clone_with_repo_name_and_no_namespace(self):
repo_url = self._api.create_repo(
repo_id=self.REPO_NAME, token=self._token, repo_type="dataset"
)
self.assertRaises(
OSError,
Repository,
f"{WORKING_REPO_DIR}/{self.REPO_NAME}",
clone_from=self.REPO_NAME,
clone_from=repo_url,
use_auth_token=self._token,
git_user="ci",
git_email="ci@dummy.com",
Expand Down Expand Up @@ -1784,11 +1792,14 @@ def test_clone_with_repo_name_and_user_namespace(self):

@retry_endpoint
def test_clone_with_repo_name_and_no_namespace(self):
repo_url = self._api.create_repo(
repo_id=self.REPO_NAME, token=self._token, repo_type="dataset"
)
self.assertRaises(
OSError,
Repository,
f"{WORKING_DATASET_DIR}/{self.REPO_NAME}",
clone_from=self.REPO_NAME,
clone_from=repo_url,
repo_type="dataset",
use_auth_token=self._token,
git_user="ci",
Expand Down

0 comments on commit a82b09d

Please sign in to comment.