diff options
| author | Chris McDonough <chrism@plope.com> | 2011-10-07 08:54:39 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2011-10-07 08:54:39 -0400 |
| commit | b9ac2b93455399c3eb4b99b3e8b0ab3aa3274e69 (patch) | |
| tree | 40ba6254c528de831ddf17db6dc51b5f2d744439 | |
| parent | da8e2a8a84a36245eb601d6069e6ffd2a1947f46 (diff) | |
| download | pyramid-b9ac2b93455399c3eb4b99b3e8b0ab3aa3274e69.tar.gz pyramid-b9ac2b93455399c3eb4b99b3e8b0ab3aa3274e69.tar.bz2 pyramid-b9ac2b93455399c3eb4b99b3e8b0ab3aa3274e69.zip | |
add some more pserve tests
| -rw-r--r-- | pyramid/scripts/pserve.py | 2 | ||||
| -rw-r--r-- | pyramid/tests/test_scripts/test_pserve.py | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/pyramid/scripts/pserve.py b/pyramid/scripts/pserve.py index de5276a9f..ffb6b229b 100644 --- a/pyramid/scripts/pserve.py +++ b/pyramid/scripts/pserve.py @@ -333,7 +333,7 @@ class PServeCommand(object): result[name] = value return result - def quote_first_command_arg(self, arg): + def quote_first_command_arg(self, arg): # pragma: no cover """ There's a bug in Windows when running an executable that's located inside a path with a space in it. This method handles diff --git a/pyramid/tests/test_scripts/test_pserve.py b/pyramid/tests/test_scripts/test_pserve.py index bc2e9aac8..38f7d2666 100644 --- a/pyramid/tests/test_scripts/test_pserve.py +++ b/pyramid/tests/test_scripts/test_pserve.py @@ -1,4 +1,5 @@ import unittest +import os class TestPServeCommand(unittest.TestCase): def setUp(self): @@ -25,3 +26,16 @@ class TestPServeCommand(unittest.TestCase): self.assertEqual(result, None) self.assertEqual(self.out_.getvalue(), 'You must give a config file') + def test_stop_daemon_no_such_pid_file(self): + path = os.path.join(os.path.dirname(__file__), 'wontexist.pid') + inst = self._makeOne('--stop-daemon', '--pid-file=%s' % path) + inst.run() + self.assertEqual(self.out_.getvalue(),'No PID file exists in %s' % path) + + def test_stop_daemon_bad_pid_file(self): + path = __file__ + inst = self._makeOne('--stop-daemon', '--pid-file=%s' % path) + inst.run() + self.assertEqual( + self.out_.getvalue(),'Not a valid PID file in %s' % path) + |
