Esempio n. 1
0
    def test_run(self):
        def return_four():
            return 4

        l = certlib.Locker()
        res = l.run(return_four)
        self.assertEquals(4, res)
Esempio n. 2
0
 def test(self):
     l = certlib.Locker()
     # we inject threading.RLock as the lock implementation in
     # the fixture init. RLock() is actually a factory method
     # that returns a _RLock
     self.assertTrue(isinstance(l.lock, threading._RLock))
 def __init__(self, serial_numbers=None, ent_dir=None):
     self.locker = certlib.Locker()
     self.ent_dir = ent_dir