コード例 #1
0
ファイル: test_shell.py プロジェクト: hdnivara/gdm
 def test_other_capture(self):
     """Verify a program's output can be captured."""
     stdout = _call('echo', 'Hello, world!\n', capture=True)
     assert "Hello, world!" == stdout
コード例 #2
0
ファイル: test_shell.py プロジェクト: hdnivara/gdm
 def test_other_error_ignored(self):
     """Verify program errors can be ignored."""
     _call('git', '--invalid-git-argument', ignore=True)
コード例 #3
0
ファイル: test_shell.py プロジェクト: hdnivara/gdm
 def test_other_error_uncaught(self):
     """Verify program errors can be left uncaught."""
     with pytest.raises(CallException):
         _call('git', '--invalid-git-argument', catch=False)
コード例 #4
0
ファイル: test_shell.py プロジェクト: hdnivara/gdm
 def test_other_error(self):
     """Verify program errors are handled."""
     with pytest.raises(SystemExit):
         _call('git', '--invalid-git-argument')
コード例 #5
0
ファイル: test_shell.py プロジェクト: hdnivara/gdm
 def test_other(self, mock_command):
     """Verify directories are changed correctly."""
     _call('mock_program')
     mock_command.assert_called_once_with('mock_program')
コード例 #6
0
ファイル: test_shell.py プロジェクト: hdnivara/gdm
 def test_cd(self, mock_chdir):
     """Verify directories are changed correctly."""
     _call('cd', 'mock/dir')
     mock_chdir.assert_called_once_with('mock/dir')