def test_report_all_output_no_fetch(self, capsys): git_check.report_all(fetch=False) captured = capsys.readouterr() assert len(captured.out) > 0 assert self.scripts_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_all_invalid_input(self): with pytest.raises(ValueError): git_check.report_all(fetch='false') with pytest.raises(ValueError): git_check.report_all(fetch='True') with pytest.raises(ValueError): git_check.report_all(fetch=0) with pytest.raises(ValueError): git_check.report_all(fetch=1) with pytest.raises(ValueError): git_check.report_all(fetch=3.142) with pytest.raises(ValueError): git_check.report_all(fetch=99999999) with pytest.raises(ValueError): git_check.report_all(fetch='random text') with pytest.raises(ValueError): git_check.report_all(fetch='/') with pytest.raises(ValueError): git_check.report_all(fetch=self.test_repo) with pytest.raises(ValueError): git_check.report_all(filter='random text', fetch=False) with pytest.raises(ValueError): git_check.report_all(filter=False, fetch=False) with pytest.raises(ValueError): git_check.report_all(filter=None, fetch=False) with pytest.raises(ValueError): git_check.report_all(filter=3.142, fetch=False) with pytest.raises(ValueError): git_check.report_all(filter=99999999, fetch=False) with pytest.raises(ValueError): git_check.report_all(filter='/', fetch=False) with pytest.raises(ValueError): git_check.report_all(filter=self.test_repo, fetch=False)
def test_report_all_input(self): git_check.report_all(filter='none', fetch=False) git_check.report_all(filter='exists', fetch=False) git_check.report_all(filter='dirty', fetch=False) git_check.report_all(filter='out-of-sync', fetch=False) git_check.report_all(filter='not clean', fetch=False)
def test_report_all_output_default_fetch(self, capsys): git_check.report_all() captured = capsys.readouterr() assert 'Fetch' in captured.out
def test_report_all_output_explicit_fetch(self, capsys): git_check.report_all(fetch=True) captured = capsys.readouterr() assert 'Fetch' in captured.out