Exemplo n.º 1
0
    def testGet(self):
        domain = BaseDomain(dict={'a' : 33}, key='d')

        self.assertEqual(33, domain.get('a'))
        self.assertRaises(DomainKeyError, domain.get, 'b')

        domain2 = BaseDomain(parent=domain, dict={'c' : 44}, name='sub')
        self.assertEqual(33, domain2.get('a'))
        self.assertEqual(44, domain2.get('c'))
        self.assertRaises(DomainKeyError, domain2.get, 'b')
Exemplo n.º 2
0
 def testSet(self):
     domain = BaseDomain(key='d')
     return domain.set('fff', 'ggg').addCallback(lambda _: self.assertEqual('ggg', domain.get('fff')))