Beispiel #1
0
 def test_has(self):
     trace_ctx = TracingContext()
     self.assertFalse(trace_ctx.has('name'))
     trace_ctx.set('name', 'tester')
     self.assertTrue(trace_ctx.has('name'))
     trace_ctx.remove('name')
     self.assertFalse(trace_ctx.has('name'))
Beispiel #2
0
 def test_remove(self):
     trace_ctx = TracingContext()
     trace_ctx.set('name', 'tester')
     self.assertEqual(trace_ctx.get('name'), 'tester')
     trace_ctx.remove('name')
     self.assertIsNone(trace_ctx.get('name'))