Пример #1
0
 def test_all(self):
     """Testing for all method
     """
     b = FileStorage()
     b.reset_obj()
     self.assertFalse(b.all())
     b.new(BaseModel())
     self.assertTrue(b.all())
Пример #2
0
 def test_save(self):
     """Testing save method
     """
     b = FileStorage()
     b.reset_obj()
     b.new(BaseModel())
     b.save()
     self.assertTrue(path.isfile("file.json"))
Пример #3
0
 def test_all_empty(self):
     """Testing empty ret value
     """
     b = FileStorage()
     b.reset_obj()
     b.__objects = {}
     ret = b.all()
     self.assertFalse(b.all())