def test_show_all_invalid_input(self): with pytest.raises(ValueError): git_check.show_all(branches='false') with pytest.raises(ValueError): git_check.show_all(branches='True') with pytest.raises(ValueError): git_check.show_all(branches=0) with pytest.raises(ValueError): git_check.show_all(branches=1) with pytest.raises(ValueError): git_check.show_all(branches=3.142) with pytest.raises(ValueError): git_check.show_all(branches=99999999) with pytest.raises(ValueError): git_check.show_all(branches='random text') with pytest.raises(ValueError): git_check.show_all(branches='/') with pytest.raises(ValueError): git_check.show_all(branches=self.test_repo)
def test_show_all_default(self, capsys): git_check.show_all() # default branches = True captured = capsys.readouterr() assert 'branch' in captured.out
def test_show_all_with_branches(self, capsys): git_check.show_all(branches=True) captured = capsys.readouterr() assert 'branch' in captured.out
def test_show_all_no_branches(self, capsys): git_check.show_all(branches=False) captured = capsys.readouterr() assert 'branch' not in captured.out
def test_show_all_output(self, capsys): git_check.show_all() captured = capsys.readouterr() assert len(captured.out) > 0 assert 'clean' in captured.out assert 'dirty' in captured.out