コード例 #1
0
ファイル: test_gitdl.py プロジェクト: SanketDG/gitdl
 def test_download_exact_repo_invalid_repo(self):
     # does not contain the slash required for owner/repo format
     repo = "example"
     with requests_mock.mock() as mocker:
         mocker.get("https://api.github.com/repos/{}".format(repo),
                    status_code=404)
         with pytest.raises(Exception) as exc_info:
             with patch.dict('os.environ', {"GITHUB_API_TOKEN": "key123"}):
                 gitdl.download_exact_repo(repo)
         assert str(exc_info.value) == "Repository Not Found."
コード例 #2
0
ファイル: test_gitdl.py プロジェクト: Arpita1/gitdl
 def test_download_exact_repo_invalid_repo(self):
     # does not contain the slash required for owner/repo format
     repo = "example"
     with pytest.raises(Exception) as exc_info:
         gitdl.download_exact_repo(repo)
     assert str(exc_info.value) == "Repository Not Found."