示例#1
0
 def test_has_transaction_id(self):
     trace_ctx = TracingContext()
     self.assertFalse(trace_ctx.has_transaction_id())
     trace_ctx.set_transaction_id('123')
     self.assertTrue(trace_ctx.has_transaction_id())
     trace_ctx.remove_transaction_id()
     self.assertFalse(trace_ctx.has_transaction_id())
示例#2
0
 def test_remove_transaction_id(self):
     trace_ctx = TracingContext()
     trace_ctx.set_transaction_id('123')
     self.assertEqual(trace_ctx.get_transaction_id(), '123')
     trace_ctx.remove_transaction_id()
     self.assertIsNone(trace_ctx.get_transaction_id())