Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Example with for in test method and a typo in function.
import unittest
def support_http_method(method):
if method in ('POST', 'GETT'):
return True
return False
class SupportHttpMethodTestCase(unittest.TestCase):
def test_support(self):
expected_values = {
'POST': True,
'GET': True,
'PUT': False,
'DELETE': False
for method, expected in expected_values.items():
self.assertEqual(support_http_method(method), expected)
if __name__ == '__main__':
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.