def setUp(self): self.data = tempfile.mkdtemp() self.config = tempfile.mkdtemp() self.cache = tempfile.mkdtemp() self.appDirs = AppDirectories(self.data, self.config, self.cache) write_pid(self.appDirs)
def testReadPid(self): write_pid(self.appDirs) p = read_pid(self.appDirs) self.assertIsNotNone(p) self.assertEqual(getpid(), int(p))
def testDeletePid(self): write_pid(self.appDirs) delete_pid(self.appDirs) self.assertFalse(path.exists(path.join(self.appDirs.cache, "quikey.pid")))
def testWritePid(self): write_pid(self.appDirs) self.assertTrue(path.exists(path.join(self.appDirs.cache, "quikey.pid")))