Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add all() to db_storage #45

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add test case
Yunju Chen committed Mar 24, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 208fbf7a2087c8d6a4f99cbbe7bf616e84ca2165
11 changes: 11 additions & 0 deletions tests/test_models/test_engine/test_file_storage.py
Original file line number Diff line number Diff line change
@@ -101,3 +101,14 @@ def test_reaload_without_file(self):
self.assertTrue(True)
except:
self.assertTrue(False)

def test_delete_method(self):
'''
Tests that the delete method removes an object from the
FileStorage.__object
'''
self.storage.new(self.my_model)
key = str(self.my_model.__class__.__name__ + "." + self.my_model.id)
self.assertTrue(key in self.storage._FileStorage__objects)
self.storage.delete(self.my_model)
self.assertFalse(key in self.storage._FileStorage__objects)