def test_patch_idempotence(self):
     """ Tests repatching """
     # Already call patch in setUp but patch again
     patch()
     molten_client()
     spans = self.tracer.writer.pop()
     self.assertTrue(len(spans) > 0)
    def test_unpatch_patch(self):
        """ Tests unpatch-patch cycle """
        unpatch()
        self.assertIsNone(Pin.get_from(molten))
        molten_client()
        spans = self.tracer.writer.pop()
        self.assertEqual(len(spans), 0)

        patch()
        # Need to override Pin here as we do in setUp
        Pin.override(molten, tracer=self.tracer)
        self.assertTrue(Pin.get_from(molten) is not None)
        molten_client()
        spans = self.tracer.writer.pop()
        self.assertTrue(len(spans) > 0)
 def setUp(self):
     super(TestMolten, self).setUp()
     patch()
     Pin.override(molten, tracer=self.tracer)
 def setUp(self):
     patch()
     self.tracer = get_dummy_tracer()
     Pin.override(molten, tracer=self.tracer, service=self.TEST_SERVICE)
Exemple #5
0
 def setUp(self):
     super(TestMoltenDI, self).setUp()
     patch()
     Pin.override(molten, tracer=self.tracer, service=self.TEST_SERVICE)
Exemple #6
0
 def setUp(self):
     patch()
     self.tracer = get_dummy_tracer()
     Pin.override(molten, tracer=self.tracer)