Beispiel #1
0
 def test_fetch_all_remotes_with_progress(self, capsys):
     git_check.fetch_all_remotes(self.test_repo, show_progress=True)
     captured = capsys.readouterr()
     if len(self.test_repo.remotes) == 0:
         assert len(captured.out) == 0
     else:
         assert captured.out.startswith('Fetching')
         assert captured.out.endswith('done.\n')
Beispiel #2
0
 def test_fetch_all_remotes_invalid_repo(self):
     with pytest.raises(git.exc.NoSuchPathError):
         git_check.fetch_all_remotes(git.Repo('/not/a/path'))
     with pytest.raises(git.exc.InvalidGitRepositoryError):
         git_check.fetch_all_remotes(git.Repo('/'))
Beispiel #3
0
 def test_fetch_all_remotes_invalid_input(self):
     with pytest.raises(ValueError):
         git_check.fetch_all_remotes(self.test_dir)
     with pytest.raises(ValueError):
         git_check.fetch_all_remotes('Random text')
     with pytest.raises(ValueError):
         git_check.fetch_all_remotes(3.142)
     with pytest.raises(ValueError):
         git_check.fetch_all_remotes(99999999)
     with pytest.raises(ValueError):
         git_check.fetch_all_remotes('/usr/bin')
     with pytest.raises(ValueError):
         git_check.fetch_all_remotes('C:\\Windows\\')
     with pytest.raises(ValueError):
         git_check.fetch_all_remotes(self.test_dir, False)
     with pytest.raises(ValueError):
         git_check.fetch_all_remotes('Random text', False)
     with pytest.raises(ValueError):
         git_check.fetch_all_remotes(3.142, False)
     with pytest.raises(ValueError):
         git_check.fetch_all_remotes(99999999, False)
     with pytest.raises(ValueError):
         git_check.fetch_all_remotes('/usr/bin', False)
     with pytest.raises(ValueError):
         git_check.fetch_all_remotes('C:\\Windows\\', False)
     with pytest.raises(ValueError):
         git_check.fetch_all_remotes(self.test_repo, 'false')
     with pytest.raises(ValueError):
         git_check.fetch_all_remotes(self.test_repo, 'True')
     with pytest.raises(ValueError):
         git_check.fetch_all_remotes(self.test_repo, 1)
     with pytest.raises(ValueError):
         git_check.fetch_all_remotes(self.test_repo, 0)
     with pytest.raises(ValueError):
         git_check.fetch_all_remotes(self.test_repo, 3.142)
     with pytest.raises(ValueError):
         git_check.fetch_all_remotes(self.test_repo, 99999999)
     with pytest.raises(ValueError):
         git_check.fetch_all_remotes(self.test_repo, 'random text')
     with pytest.raises(ValueError):
         git_check.fetch_all_remotes(self.test_repo, '/')
     with pytest.raises(ValueError):
         git_check.fetch_all_remotes(self.test_repo, self.test_repo)
Beispiel #4
0
 def test_fetch_all_remotes_default(self, capsys):
     git_check.fetch_all_remotes(self.test_repo) # default show_progress=False
     captured = capsys.readouterr()
     assert len(captured.out) == 0