Beispiel #1
0
 def test_document_not_exist(self, bad_mock):
     """ Test a Bad Document Exists """
     bad_mock.return_value = False
     wishlist = Wishlist("fido", "1")
     wishlist.create()
     self.assertIsNone(wishlist.id)
Beispiel #2
0
 def test_key_error_on_delete(self, bad_mock):
     """ Test KeyError on delete """
     bad_mock.side_effect = KeyError()
     wishlist = Wishlist("fido", "1")
     wishlist.create()
     wishlist.delete()
Beispiel #3
0
 def test_http_error(self, bad_mock):
     """ Test a Bad Create with HTTP error """
     bad_mock.side_effect = HTTPError()
     wishlist = Wishlist("fido", "1")
     wishlist.create()
     self.assertIsNone(wishlist.id)