Ϫf6dZddlmZddlmZGddeZy)z& Tests for L{twisted.python.context}. )context)SynchronousTestCasec(eZdZdZdZdZdZdZy) ContextTestszH Tests for the module-scope APIs for L{twisted.python.context}. cL|jtjdy)zt Arbitrary keys which have not been set in the context have an associated value of L{None}. xN) assertIsNonergetselfs ;/usr/lib/python3/dist-packages/twisted/test/test_context.pytest_notPresentIfNotSetz$ContextTests.test_notPresentIfNotSets '++c*+cr|jtjdditjddy)z Values may be associated with keys by passing them in a dictionary as the first argument to L{twisted.python.context.call}. ryN) assertEqualrcallr r s r test_setByCallzContextTests.test_setByCalls) sCj'++sCSIrc~tjddid|jtjdy)z After a L{twisted.python.context.call} completes, keys specified in the call are no longer associated with the values from that call. rrcy)Nrrr z2ContextTests.test_unsetAfterCall..%srN)rrr r r s r test_unsetAfterCallz ContextTests.test_unsetAfterCall s-  c3Z. '++c*+rct}|jtjj|dtj |d|j dtj|y)zy A default value may be set for a key in the context using L{twisted.python.context.setDefault}. Nr)object addCleanuprdefaultContextDictpop setDefaultrr )r keys r test_setDefaultzContextTests.test_setDefault(sP h 2266TB3$ gkk#./rN)__name__ __module__ __qualname____doc__rrrr!rrr rr s,J,0rrN)r%twisted.pythonrtwisted.trial.unittestrrrrr r(s #6#0&#0r