def test_report_output_no_fetch(self, capsys): git_check.report(self.test_repo, fetch=False) captured = capsys.readouterr() assert len(captured.out) > 0 assert self.test_dir in captured.out assert 'Remotes' in captured.out assert 'Fetch' not in captured.out assert 'Branches' in captured.out assert 'Status' in captured.out
def test_report_invalid_repo(self): with pytest.raises(git.exc.NoSuchPathError): git_check.report(git.Repo('/not/a/path'), fetch=False) with pytest.raises(git.exc.InvalidGitRepositoryError): git_check.report(git.Repo('/'), fetch=False)
def test_report_invalid_input(self): with pytest.raises(ValueError): git_check.report(self.test_dir, fetch=False) with pytest.raises(ValueError): git_check.report('Random text', fetch=False) with pytest.raises(ValueError): git_check.report(3.142, fetch=False) with pytest.raises(ValueError): git_check.report(99999999, fetch=False) with pytest.raises(ValueError): git_check.report('/usr/bin', fetch=False) with pytest.raises(ValueError): git_check.report('C:\\Windows\\', fetch=False) with pytest.raises(ValueError): git_check.report(self.test_repo, fetch='false') with pytest.raises(ValueError): git_check.report(self.test_repo, fetch='True') with pytest.raises(ValueError): git_check.report(self.test_repo, fetch=1) with pytest.raises(ValueError): git_check.report(self.test_repo, fetch=0) with pytest.raises(ValueError): git_check.report(self.test_repo, fetch=3.142) with pytest.raises(ValueError): git_check.report(self.test_repo, fetch=99999999) with pytest.raises(ValueError): git_check.report(self.test_repo, fetch='random text') with pytest.raises(ValueError): git_check.report(self.test_repo, fetch='/') with pytest.raises(ValueError): git_check.report(self.test_repo, fetch=self.test_repo)
def test_report_output_default_fetch(self, capsys): git_check.report(self.test_repo) captured = capsys.readouterr() assert 'Fetch' in captured.out
def test_report_output_explicit_fetch(self, capsys): git_check.report(self.test_repo, fetch=True) captured = capsys.readouterr() assert 'Fetch' in captured.out