Пример #1
0
    def testDerive(self):
        e1 = Env()
        e2 = e1.derive()

        e1.get('bar')
        e2.get('foo')

        self.assertEqual(e1.touchedKeys(), set(['foo', 'bar']))
        self.assertEqual(e2.touchedKeys(), set(['foo', 'bar']))
Пример #2
0
    def testDeriveResetSplit(self):
        e1 = Env()
        e2 = e1.derive()
        e2.touchReset()
        e3 = e1.derive()
        e3.touchReset()

        e1.get('bar')
        e2.get('foo')
        e3.get('baz')

        self.assertEqual(e1.touchedKeys(), set(['foo', 'bar', 'baz']))
        self.assertEqual(e2.touchedKeys(), set(['foo']))
        self.assertEqual(e3.touchedKeys(), set(['baz']))