示例#1
0
 def test_other_capture(self):
     """Verify a program's output can be captured."""
     stdout = shell.call('echo', 'Hello, world!\n', _capture=True)
     assert "Hello, world!" == stdout
示例#2
0
 def test_other_error_uncaught(self):
     """Verify program errors raise exceptions."""
     with pytest.raises(ShellError):
         shell.call('git', '--invalid-git-argument')
示例#3
0
 def test_other_error_ignored(self):
     """Verify program errors can be ignored."""
     shell.call('git', '--invalid-git-argument', _ignore=True)
示例#4
0
 def test_cd(self, mock_chdir):
     """Verify directories are changed correctly."""
     shell.call('cd', 'mock/dir')
     mock_chdir.assert_called_once_with('mock/dir')
示例#5
0
 def test_other(self, mock_command):
     """Verify directories are changed correctly."""
     shell.call('mock_program')
     mock_command.assert_called_once_with('mock_program')
示例#6
0
文件: test_shell.py 项目: nta/gdm
 def test_other_error_ignored(self):
     """Verify program errors can be ignored."""
     shell.call('git', '--invalid-git-argument', _ignore=True)
示例#7
0
文件: test_shell.py 项目: nta/gdm
 def test_other_capture(self):
     """Verify a program's output can be captured."""
     stdout = shell.call('echo', 'Hello, world!\n', _capture=True)
     assert "Hello, world!" == stdout
示例#8
0
文件: test_shell.py 项目: nta/gdm
 def test_other_error_uncaught(self):
     """Verify program errors raise exceptions."""
     with pytest.raises(ShellError):
         shell.call('git', '--invalid-git-argument')
示例#9
0
文件: test_shell.py 项目: nta/gdm
 def test_other(self, mock_command):
     """Verify directories are changed correctly."""
     shell.call('mock_program')
     mock_command.assert_called_once_with('mock_program')
示例#10
0
文件: test_shell.py 项目: nta/gdm
 def test_cd(self, mock_chdir):
     """Verify directories are changed correctly."""
     shell.call('cd', 'mock/dir')
     mock_chdir.assert_called_once_with('mock/dir')
示例#11
0
文件: test_shell.py 项目: beddari/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)
示例#12
0
文件: test_shell.py 项目: beddari/gdm
 def test_other_error(self):
     """Verify program errors are handled."""
     with pytest.raises(SystemExit):
         call('git', '--invalid-git-argument')