Ejemplo n.º 1
0
 def test_complex_miss(self):
     with self.assertRaises(AttributeError):
         lookup_data('more.nested.nope', self.dict_data)
Ejemplo n.º 2
0
 def test_obj_miss(self):
     with self.assertRaises(AttributeError):
         lookup_data('whee', self.obj_data)
Ejemplo n.º 3
0
 def test_empty_lookup(self):
     # We could possibly get here in the recursion.
     self.assertEqual(lookup_data('', 'Last value'), 'Last value')
Ejemplo n.º 4
0
 def test_obj_nested(self):
     self.assertEqual(lookup_data('moof.buried.id', self.obj_data), 7)
     self.assertEqual(lookup_data('moof.buried.data.yes', self.obj_data), 'no')
Ejemplo n.º 5
0
 def test_dict_miss(self):
     with self.assertRaises(KeyError):
         lookup_data('another', self.dict_data)
Ejemplo n.º 6
0
 def test_obj_simple(self):
     self.assertEqual(lookup_data('say', self.obj_data), 'what')
     self.assertEqual(lookup_data('count', self.obj_data), 453)
Ejemplo n.º 7
0
 def test_dict_nested(self):
     self.assertEqual(lookup_data('more.things', self.dict_data), 'here')
     self.assertEqual(lookup_data('more.nested.depth', self.dict_data), 3)
Ejemplo n.º 8
0
 def test_complex_miss(self):
     with self.assertRaises(AttributeError):
         lookup_data('more.nested.nope', self.dict_data)
Ejemplo n.º 9
0
 def test_dict_simple(self):
     self.assertEqual(lookup_data('hello', self.dict_data), 'world')
     self.assertEqual(lookup_data('abc', self.dict_data), 123)
Ejemplo n.º 10
0
 def test_obj_miss(self):
     with self.assertRaises(AttributeError):
         lookup_data('whee', self.obj_data)
Ejemplo n.º 11
0
 def test_empty_lookup(self):
     # We could possibly get here in the recursion.
     self.assertEqual(lookup_data('', 'Last value'), 'Last value')
Ejemplo n.º 12
0
 def test_dict_miss(self):
     with self.assertRaises(KeyError):
         lookup_data('another', self.dict_data)
Ejemplo n.º 13
0
 def test_obj_nested(self):
     self.assertEqual(lookup_data('moof.buried.id', self.obj_data), 7)
     self.assertEqual(lookup_data('moof.buried.data.yes', self.obj_data),
                      'no')
Ejemplo n.º 14
0
 def test_dict_nested(self):
     self.assertEqual(lookup_data('more.things', self.dict_data), 'here')
     self.assertEqual(lookup_data('more.nested.depth', self.dict_data), 3)
Ejemplo n.º 15
0
 def test_obj_simple(self):
     self.assertEqual(lookup_data('say', self.obj_data), 'what')
     self.assertEqual(lookup_data('count', self.obj_data), 453)
Ejemplo n.º 16
0
 def test_dict_simple(self):
     self.assertEqual(lookup_data('hello', self.dict_data), 'world')
     self.assertEqual(lookup_data('abc', self.dict_data), 123)