コード例 #1
0
 def test_default_single_depth(self):
     self.assertEqual(
         dict_lookup(
             self.theDict,
             ['nothing']
         ),
         None
     )
コード例 #2
0
 def test_default_multi_depth(self):
     self.assertEqual(
         dict_lookup(
             self.theDict,
             ['pandas', 'bad']
         ),
         None
     )
コード例 #3
0
 def test_dict(self):
     self.assertEqual(
         dict_lookup(
             self.theDict,
             ['foxes']
         ),
         self.theDict['foxes']
     )
コード例 #4
0
 def test_basic_two(self):
     self.assertEqual(
         dict_lookup(
             self.theDict,
             ['foxes', 'are']
         ),
         'sneaky'
     )
コード例 #5
0
 def test_basic_one(self):
     self.assertEqual(
         dict_lookup(
             self.theDict,
             ['pandas', 'and']
         ),
         'awesome'
     )
コード例 #6
0
 def test_user_default_multi_depth(self):
     self.assertEqual(
         dict_lookup(
             self.theDict,
             ['pandas', 'bad'],
             'NO, THAT\'S A DAMN DIRTY LIE'
         ),
         'NO, THAT\'S A DAMN DIRTY LIE'
     )
コード例 #7
0
 def test_user_default_single_depth(self):
     self.assertEqual(
         dict_lookup(
             self.theDict,
             ['nothing'],
             'Nobody here but us chickens'
         ),
         'Nobody here but us chickens'
     )
コード例 #8
0
 def test_basic_none(self):
     self.assertEqual(
         dict_lookup(
             self.theDict,
             ['badgers', 'are'],
             'Badgers are none? What?'
         ),
         None
     )
コード例 #9
0
 def test_user_default_multi_depth(self):
     self.assertEqual(
         dict_lookup(self.theDict, ['pandas', 'bad'],
                     'NO, THAT\'S A DAMN DIRTY LIE'),
         'NO, THAT\'S A DAMN DIRTY LIE')
コード例 #10
0
 def test_default_multi_depth(self):
     self.assertEqual(dict_lookup(self.theDict, ['pandas', 'bad']), None)
コード例 #11
0
 def test_user_default_single_depth(self):
     self.assertEqual(
         dict_lookup(self.theDict, ['nothing'],
                     'Nobody here but us chickens'),
         'Nobody here but us chickens')
コード例 #12
0
 def test_default_single_depth(self):
     self.assertEqual(dict_lookup(self.theDict, ['nothing']), None)
コード例 #13
0
 def test_dict(self):
     self.assertEqual(dict_lookup(self.theDict, ['foxes']),
                      self.theDict['foxes'])
コード例 #14
0
 def test_basic_none(self):
     self.assertEqual(
         dict_lookup(self.theDict, ['badgers', 'are'],
                     'Badgers are none? What?'), None)
コード例 #15
0
 def test_basic_two(self):
     self.assertEqual(dict_lookup(self.theDict, ['foxes', 'are']), 'sneaky')
コード例 #16
0
 def test_basic_one(self):
     self.assertEqual(dict_lookup(self.theDict, ['pandas', 'and']),
                      'awesome')