Created
October 10, 2011 21:03
-
-
Save Lothiraldan/1276534 to your computer and use it in GitHub Desktop.
Example with nosetest test generator.
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
def support_http_method(method): | |
if method in ('POST', 'GET'): | |
return True | |
else: | |
return False | |
def test_support(): | |
expected_values = { | |
'POST': True, | |
'GET': True, | |
'PUT': False, | |
'DELETE': False | |
} | |
for method, expected in expected_values.items(): | |
yield check_support, method, expected | |
def check_support(method, expected): | |
assert support_http_method(method) == expected |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment