示例#1
0
    def test_patch_idempotence(self):
        key = 'test/patch/idempotence'

        patch()
        patch()

        self.c.kv.get(key)
        assert self.spans
        assert isinstance(self.c.kv.get, BoundFunctionWrapper)

        unpatch()
        self.reset()

        self.c.kv.get(key)
        assert not self.spans
        assert not isinstance(self.c.kv.get, BoundFunctionWrapper)
示例#2
0
 def tearDown(self):
     unpatch()
     super(TestConsulPatch, self).tearDown()