Exemple #1
0
 def test_removePIDErrors(self):
     """
     Calling L{UnixApplicationRunner.removePID} with a non-existent filename logs
     an OSError.
     """
     runner = UnixApplicationRunner({})
     runner.removePID("fakepid")
     errors = self.flushLoggedErrors(OSError)
     self.assertEquals(len(errors), 1)
     self.assertEquals(errors[0].value.errno, errno.ENOENT)
Exemple #2
0
 def test_removePIDErrors(self):
     """
     Calling L{UnixApplicationRunner.removePID} with a non-existent filename logs
     an OSError.
     """
     runner = UnixApplicationRunner({})
     runner.removePID("fakepid")
     errors = self.flushLoggedErrors(OSError)
     self.assertEqual(len(errors), 1)
     self.assertEqual(errors[0].value.errno, errno.ENOENT)
Exemple #3
0
 def test_removePID(self):
     """
     L{UnixApplicationRunner.removePID} deletes the file the name of
     which is passed to it.
     """
     runner = UnixApplicationRunner({})
     path = self.mktemp()
     os.makedirs(path)
     pidfile = os.path.join(path, "foo.pid")
     file(pidfile, "w").close()
     runner.removePID(pidfile)
     self.assertFalse(os.path.exists(pidfile))
Exemple #4
0
 def test_removePID(self):
     """
     L{UnixApplicationRunner.removePID} deletes the file the name of
     which is passed to it.
     """
     runner = UnixApplicationRunner({})
     path = self.mktemp()
     os.makedirs(path)
     pidfile = os.path.join(path, "foo.pid")
     file(pidfile, "w").close()
     runner.removePID(pidfile)
     self.assertFalse(os.path.exists(pidfile))