Created
June 26, 2015 10:09
-
-
Save imsickofmaps/21afde13574d91d0f887 to your computer and use it in GitHub Desktop.
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
actual = { | |
"key1": "yes", | |
"key2": "yes", | |
"key3": "yes" | |
} | |
expect = ["key1", "key2", "key3"] | |
present = set(key in actual.keys() for key in expect) | |
if len(present) == 1 and list(present)[0] == True: | |
print "present and correct" | |
else: | |
print "keys missing" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment