예제 #1
0
 def test_values(self):
     d = OrderedDictWithDefaults()
     d['name'] = 'Paul'
     d['color'] = 'Green'
     values = d.values()
     self.assertTrue(len(values) == 2)
     self.assertTrue('Paul' in values)
     self.assertTrue('Green' in values)
예제 #2
0
 def test_values(self):
     d = OrderedDictWithDefaults()
     d['name'] = 'Paul'
     d['color'] = 'Green'
     values = list(d.values())
     self.assertTrue(len(values) == 2)
     self.assertTrue('Paul' in values)
     self.assertTrue('Green' in values)
예제 #3
0
 def test_itervalues(self):
     d = OrderedDictWithDefaults()
     self.assertEqual([], list(d.items()))
     d['key'] = 'Birds'
     d['len'] = '89'
     d.defaults_ = {'surname': 'Wyndham'}
     count = 0
     for k in d.values():
         self.assertTrue(k in ['Birds', '89', 'Wyndham'])
         count += 1
     self.assertEqual(3, count)
예제 #4
0
 def test_itervalues(self):
     d = OrderedDictWithDefaults()
     self.assertEqual([], list(d.items()))
     d['key'] = 'Birds'
     d['len'] = '89'
     d.defaults_ = {
         'surname': 'Wyndham'
     }
     count = 0
     for k in d.values():
         self.assertTrue(k in ['Birds', '89', 'Wyndham'])
         count += 1
     self.assertEqual(3, count)