コード例 #1
0
ファイル: test_git_check.py プロジェクト: mattachu/Scripts
 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)
コード例 #2
0
ファイル: test_git_check.py プロジェクト: mattachu/Scripts
 def test_show_all_default(self, capsys):
     git_check.show_all() # default branches = True
     captured = capsys.readouterr()
     assert 'branch' in captured.out
コード例 #3
0
ファイル: test_git_check.py プロジェクト: mattachu/Scripts
 def test_show_all_with_branches(self, capsys):
     git_check.show_all(branches=True)
     captured = capsys.readouterr()
     assert 'branch' in captured.out
コード例 #4
0
ファイル: test_git_check.py プロジェクト: mattachu/Scripts
 def test_show_all_no_branches(self, capsys):
     git_check.show_all(branches=False)
     captured = capsys.readouterr()
     assert 'branch' not in captured.out
コード例 #5
0
ファイル: test_git_check.py プロジェクト: mattachu/Scripts
 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