Beispiel #1
0
 def test_copy(self):
     Cache.clean()
     id = 'd'
     new_id = 'new_' + id
     Cache.add(self.__d, id)
     Cache.copy(id, new_id)
     self.assertDictEqual(Cache.get(new_id), self.__d)
Beispiel #2
0
 def test_get_list_of_objects(self):
     Cache.clean()
     Cache.add(self.__d, 'd')
     self.assertListEqual(Cache.get_list_of_objects(), ['d'])
Beispiel #3
0
 def test_get_objects(self):
     Cache.clean()
     Cache.add(self.__d, 'd')
     self.assertDictEqual(Cache.get_objects(), {'d': self.__d})
Beispiel #4
0
 def test_get_wrong_id(self):
     Cache.clean()
     Cache.add(self.__d, 'd')
     self.assertEqual(Cache.get('d1'), None)
Beispiel #5
0
 def test_remove_object_by_wrong_id(self):
     Cache.clean()
     Cache.add(self.__d, 'd')
     Cache.remove_object_by_id('d1')
     self.assertDictEqual(Cache.get('d'), self.__d)
Beispiel #6
0
 def test_remove_object_by_id(self):
     Cache.clean()
     Cache.add(self.__d, 'd')
     Cache.remove_object_by_id('d')
     self.assertEqual(Cache.get('d'), None)
Beispiel #7
0
 def test_rename_wrong_id(self):
     Cache.clean()
     Cache.add(self.__d, 'd')
     Cache.rename('d2', 'd1')
     self.assertEqual(Cache.get('d1'), None)
     self.assertDictEqual(Cache.get('d'), self.__d)
Beispiel #8
0
 def test_add_wo_id(self):
     Cache.clean()
     Cache.add(self.__d)
     self.assertEqual(Cache.get('d'), None)
Beispiel #9
0
 def test_add_with_id(self):
     Cache.clean()
     Cache.add(self.__d, 'd')
     self.assertDictEqual(Cache.get('d'), self.__d)