Last active
December 13, 2017 18:13
-
-
Save dyspop/041e5c76da9b677a0e31f1ad3315371f to your computer and use it in GitHub Desktop.
pytest style in question
This file contains 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
"""Tests for each individual function in the Client.""" | |
import responsysrest as r | |
def dict_contains_key(d, k): | |
"""Test if the key is in the dictionary.""" | |
return k in d | |
def test_get_context(): | |
"""Test the get context function.""" | |
context = r.get_context() | |
# is dict | |
assert type(context) == dict | |
# contains required keys | |
keys = ['authToken', 'endPoint'] | |
for key in keys: | |
assert dict_contains_key(context, key) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment