Exemplo n.º 1
0
 def test_clz_to_dict_mapping(self):
     clz_to_dict = m(self.dummy_class, self.dummy_dict)
     #Process
     result = clz_to_dict \
                 .field('key1', 'dkey1') \
                 .field('key2', 'dkey2') \
                 .field('key3') \
                 .build()
     #Validate
     self.assertEqual('abc', self.dummy_dict['dkey1'])
     self.assertEqual('xyz', self.dummy_dict['dkey2'])
     self.assertEqual('qrs', self.dummy_dict['key3'])
Exemplo n.º 2
0
 def test_clz_to_dict_mapping(self):
     clz_to_dict = m(self.dummy_class, self.dummy_dict)
     #Process
     result = clz_to_dict \
                 .field('key1', 'dkey1') \
                 .field('key2', 'dkey2') \
                 .field('key3') \
                 .build()
     #Validate
     self.assertEqual('abc', self.dummy_dict['dkey1'])
     self.assertEqual('xyz', self.dummy_dict['dkey2'])
     self.assertEqual('qrs', self.dummy_dict['key3'])
Exemplo n.º 3
0
 def test_dict_to_clz_mapping(self):
     dict_to_clz = m(self.dummy_dict, self.dummy_class)
     #Process
     result = dict_to_clz \
                 .field('dkey1', 'key1') \
                 .field('dkey2', 'key2') \
                 .field('key3') \
                 .build()
     #Validate
     self.assertIsInstance(result, DummySource)
     self.assertEqual('123', self.dummy_class.key1)
     self.assertEqual(456, self.dummy_class.key2)
     self.assertEqual('yui', self.dummy_class.key3)
Exemplo n.º 4
0
 def test_dict_to_clz_mapping(self):
     dict_to_clz = m(self.dummy_dict, self.dummy_class)
     #Process
     result = dict_to_clz \
                 .field('dkey1', 'key1') \
                 .field('dkey2', 'key2') \
                 .field('key3') \
                 .build()
     #Validate
     self.assertIsInstance(result, DummySource)
     self.assertEqual('123', self.dummy_class.key1)
     self.assertEqual(456, self.dummy_class.key2)
     self.assertEqual('yui', self.dummy_class.key3)