Skip to content

Instantly share code, notes, and snippets.

@mrrizal
Created January 9, 2021 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrrizal/6f79b7de5ce278edebb0c0240768bf45 to your computer and use it in GitHub Desktop.
Save mrrizal/6f79b7de5ce278edebb0c0240768bf45 to your computer and use it in GitHub Desktop.
from hello import Hello
def test_greeting():
hello_obj = Hello()
assert hello_obj.greeting("Rizal") == "Hello Rizal!"
def test_location():
hello_obj = Hello()
status_code, response = hello_obj.get_location()
assert status_code == 200
assert isinstance(response, dict)
for field in ['ip', 'city', 'region', 'country', 'loc', 'org', 'timezone', 'readme']:
assert field in response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment