Skip to content

Commit

Permalink
update coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Kasulejoseph committed Oct 6, 2018
1 parent 2ab19f6 commit 5af6e79
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .coverage

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions tests/test_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,30 @@ def test_user_successfull_create_an_order(self):
self.assertEqual(data['message'], 'Order successfully submited')
self.assertEqual(data['status'], 'Success')

def test_nothing_on_menu(self):
Database().fetch_menu()
result = self.client.get(
'/api/v1/menu',
content_type="application/json"
)
data = json.loads(result.data.decode())
self.assertEqual(result.status_code, 404)
self.assertIn('nothing on menu today', str(data))

def test_all_menu_items_fetched_successfully(self):
item = {
"meal": "katogo",
"description": "all",
"price": 2000
}
Database().add_to_menu(item['meal'], item['description'], item['price'])
Database().fetch_menu()
result = self.client.get(
'/api/v1/menu',
content_type="application/json",
data=json.dumps(item)
)
data = json.loads(result.data.decode())
self.assertEqual(result.status_code, 200)


0 comments on commit 5af6e79

Please sign in to comment.