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