def test_is_locked(self, exists): p = Pidfile('/var/pid') exists.return_value = True with patch.object(p, '_is_stale', return_value=False): assert p.is_locked() with patch.object(p, '_is_stale', return_value=True): assert not p.is_locked() exists.return_value = False assert not p.is_locked()
def test_is_locked(self, exists): p = Pidfile('/var/pid') exists.return_value = True assert p.is_locked() exists.return_value = False assert not p.is_locked()
def test_is_locked(self, exists): p = Pidfile('/var/pid') exists.return_value = True self.assertTrue(p.is_locked()) exists.return_value = False self.assertFalse(p.is_locked())