Example #1
0
 def test_update_exceptions(self):
     a = VDFDict()
     with self.assertRaises(TypeError):
         a.update(None)
     with self.assertRaises(TypeError):
         a.update(1)
     with self.assertRaises(TypeError):
         a.update("asd zxc")
     with self.assertRaises(ValueError):
         a.update([(1, 1, 1), (2, 2, 2)])
Example #2
0
 def test_update_exceptions(self):
     a = VDFDict()
     with self.assertRaises(TypeError):
         a.update(None)
     with self.assertRaises(TypeError):
         a.update(1)
     with self.assertRaises(TypeError):
         a.update("asd zxc")
     with self.assertRaises(ValueError):
         a.update([(1,1,1), (2,2,2)])
Example #3
0
 def test_update(self):
     a = VDFDict([("1", 2), ("1", 2), ("5", 3), ("1", 2)])
     b = VDFDict()
     b.update([("1", 2), ("1", 2)])
     b.update([("5", 3), ("1", 2)])
     self.assertEqual(list(a.items()), list(b.items()))
Example #4
0
 def test_update(self):
     a = VDFDict([("1",2),("1",2),("5",3),("1",2)])
     b = VDFDict()
     b.update([("1",2),("1",2)])
     b.update([("5",3),("1",2)])
     self.assertEqual(list(a.items()), list(b.items()))