def test_acquire(self): pidfile = pep3143daemon.pidfile.PidFile(self.pidfile) pidfile.acquire() self.assertIsInstance(pidfile.pidfile, _io.TextIOWrapper) self.assertEqual(pidfile.pidfile.name, self.pidfile) self.assertFalse(pidfile.pidfile.closed) pidfile.release()
def test_release(self): pidfile = pep3143daemon.pidfile.PidFile(self.pidfile) pidfile.acquire() pidfile.release() self.assertTrue(pidfile.pidfile.closed)