Created
March 8, 2023 16:15
-
-
Save mhassanist/785326d39f134e9b92d525684ab515d2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import unittest | |
class TestNotesAPI(unittest.TestCase): | |
base_url = "https://afternoon-beach-08354.herokuapp.com/" | |
def test_add_note(self): | |
sample_note = {"content": "do prog2 assignment sooon!"} | |
response = requests.post(TestNotesAPI.base_url + "/notes", | |
json=sample_note) | |
self.assertEqual(response.status_code, 201) | |
#make sure the returned object is actually equals to the passed object | |
self.assertEqual(response.json()['content'], sample_note["content"]) | |
self.assertEqual("note_id" in response.json(), True) | |
def test_remove_note(self): | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment