Exemplo n.º 1
0
 def setUp(self):
     entry = self.entry = distributedcontext.Entry(
         distributedcontext.EntryMetadata(
             distributedcontext.EntryMetadata.NO_PROPAGATION),
         distributedcontext.EntryKey("key"),
         distributedcontext.EntryValue("value"),
     )
     self.context = distributedcontext.DistributedContext((entry, ))
 def test_use_context(self):
     expected = distributedcontext.DistributedContext(
         (distributedcontext.Entry(
             distributedcontext.EntryMetadata(0),
             distributedcontext.EntryKey("0"),
             distributedcontext.EntryValue(""),
         ), ))
     with self.manager.use_context(expected) as output:
         self.assertIs(output, expected)
Exemplo n.º 3
0
 def test_key_new(self):
     key = distributedcontext.EntryValue("ok")
     self.assertEqual(key, "ok")