From d67df81cbc1b4fafa967380b1f56ce5b33c604bc Mon Sep 17 00:00:00 2001 From: dianaclarke Date: Mon, 12 Mar 2012 18:55:16 -0400 Subject: test the contents of the pid file in the exception cases --- pyramid/tests/test_scripts/test_pserve.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyramid/tests/test_scripts/test_pserve.py b/pyramid/tests/test_scripts/test_pserve.py index 534bb37aa..c1b91e3ae 100644 --- a/pyramid/tests/test_scripts/test_pserve.py +++ b/pyramid/tests/test_scripts/test_pserve.py @@ -74,6 +74,8 @@ class TestPServeCommand(unittest.TestCase): 'Cannot remove PID file: (Some OSError - unlink)', 'Stale PID removed'] self._assert_pid_file_not_removed(msg=''.join(msg)) + with open(self.pid_file) as f: + self.assertEqual(f.read(), '') def test_remove_pid_file_stale_pid_write_exception(self): inst = self._makeOneWithPidFile(os.getpid()) @@ -84,6 +86,8 @@ class TestPServeCommand(unittest.TestCase): 'Stale PID left in file: %s ' % (self.pid_file), '(Some OSError - open)'] self._assert_pid_file_not_removed(msg=''.join(msg)) + with open(self.pid_file) as f: + self.assertEqual(int(f.read()), os.getpid()) def test_record_pid_verbose(self): self._assert_record_pid(verbosity=2, msg='Writing PID %d to %s') -- cgit v1.2.3