Beispiel #1
0
 def test_complex_miss(self):
     with self.assertRaises(AttributeError):
         lookup_data('more.nested.nope', self.dict_data)
Beispiel #2
0
 def test_obj_miss(self):
     with self.assertRaises(AttributeError):
         lookup_data('whee', self.obj_data)
Beispiel #3
0
 def test_empty_lookup(self):
     # We could possibly get here in the recursion.
     self.assertEqual(lookup_data('', 'Last value'), 'Last value')
Beispiel #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')
Beispiel #5
0
 def test_dict_miss(self):
     with self.assertRaises(KeyError):
         lookup_data('another', self.dict_data)
Beispiel #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)
Beispiel #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)
Beispiel #8
0
 def test_complex_miss(self):
     with self.assertRaises(AttributeError):
         lookup_data('more.nested.nope', self.dict_data)
Beispiel #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)
Beispiel #10
0
 def test_obj_miss(self):
     with self.assertRaises(AttributeError):
         lookup_data('whee', self.obj_data)
Beispiel #11
0
 def test_empty_lookup(self):
     # We could possibly get here in the recursion.
     self.assertEqual(lookup_data('', 'Last value'), 'Last value')
Beispiel #12
0
 def test_dict_miss(self):
     with self.assertRaises(KeyError):
         lookup_data('another', self.dict_data)
Beispiel #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')
Beispiel #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)
Beispiel #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)
Beispiel #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)