Ejemplo n.º 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()
Ejemplo n.º 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()
Ejemplo n.º 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())
Ejemplo n.º 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()
Ejemplo n.º 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())