예제 #1
0
    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()
예제 #2
0
 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()
예제 #3
0
 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())
예제 #4
0
 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()
예제 #5
0
 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())