예제 #1
0
파일: test_sops.py 프로젝트: kindlyops/sops
 def test_panic_handles_exit_error_code(self):
     with mock.patch.object(builtins, 'print'):
         with mock.patch("sys.exit") as sys_exit_mock:
             sops.panic("Foobar", 111)
             sys_exit_mock.assert_called_with(111)
예제 #2
0
 def test_panic_handles_exit_error_code(self):
     with mock.patch.object(builtins, 'print'):
         with mock.patch("sys.exit") as sys_exit_mock:
             sops.panic("Foobar", 111)
             sys_exit_mock.assert_called_with(111)
예제 #3
0
파일: test_sops.py 프로젝트: kindlyops/sops
 def test_panic_writes_to_stderr(self):
     with mock.patch.object(builtins, 'print') as print_mock:
         with mock.patch("sys.exit") as sys_exit_mock:
             sops.panic("Foobar")
             print_mock.assert_called_with("PANIC: Foobar", file=sys.stderr)
             sys_exit_mock.assert_called_with(1)
예제 #4
0
 def test_panic_writes_to_stderr(self):
     with mock.patch.object(builtins, 'print') as print_mock:
         with mock.patch("sys.exit") as sys_exit_mock:
             sops.panic("Foobar")
             print_mock.assert_called_with("PANIC: Foobar", file=sys.stderr)
             sys_exit_mock.assert_called_with(1)