コード例 #1
0
ファイル: tests.py プロジェクト: waytai/check-manifest
 def test_run_no_such_program(self):
     from check_manifest import run, Failure
     with self.assertRaises(Failure) as cm:
         run(["there-is-really-no-such-program"])
     self.assertTrue(
         str(cm.exception).startswith(
             "could not run ['there-is-really-no-such-program']:"
             " [Errno 2] No such file or directory"))
コード例 #2
0
ファイル: tests.py プロジェクト: fschulze/check-manifest
 def test_run_no_such_program(self):
     from check_manifest import run, Failure
     with self.assertRaises(Failure) as cm:
         run(["there-is-really-no-such-program"])
     # Linux says "[Errno 2] No such file or directory"
     # Windows says "[Error 2] The system cannot find the file specified"
     # but on 3.x it's "[WinErr 2] The system cannot find the file specified"
     should_start_with = "could not run ['there-is-really-no-such-program']:"
     self.assertTrue(
         str(cm.exception).startswith(should_start_with),
         '\n%r does not start with\n%r' % (str(cm.exception),
                                           should_start_with))
コード例 #3
0
ファイル: tests.py プロジェクト: rgommers/check-manifest
 def test_run_no_such_program(self):
     from check_manifest import run, Failure
     with self.assertRaises(Failure) as cm:
         run(["there-is-really-no-such-program"])
     # Linux says "[Errno 2] No such file or directory"
     # Windows says "[Error 2] The system cannot find the file specified"
     # but on 3.x it's "[WinErr 2] The system cannot find the file specified"
     should_start_with = "could not run ['there-is-really-no-such-program']:"
     self.assertTrue(
         str(cm.exception).startswith(should_start_with),
         '\n%r does not start with\n%r' %
         (str(cm.exception), should_start_with))
コード例 #4
0
ファイル: tests.py プロジェクト: fschulze/check-manifest
 def test_run_failure(self):
     from check_manifest import run, CommandFailed
     with self.assertRaises(CommandFailed) as cm:
         run(["false"])
     self.assertEqual(str(cm.exception),
                      "['false'] failed (status 1):\n")
コード例 #5
0
ファイル: tests.py プロジェクト: fschulze/check-manifest
 def test_run_success(self):
     from check_manifest import run
     self.assertEqual(run(["true"]), "")
コード例 #6
0
ファイル: tests.py プロジェクト: rgommers/check-manifest
 def test_run_failure(self):
     from check_manifest import run, CommandFailed
     with self.assertRaises(CommandFailed) as cm:
         run(["false"])
     self.assertEqual(str(cm.exception), "['false'] failed (status 1):\n")
コード例 #7
0
ファイル: tests.py プロジェクト: rgommers/check-manifest
 def test_run_success(self):
     from check_manifest import run
     self.assertEqual(run(["true"]), "")