예제 #1
0
 def test_headers_to_dict_with_no_headers(self):
     """Should parse empty headers into an empty dictionary."""
     result = headers_to_dict(MockHeaders([]))
     self.assertEqual(result, {},'Empty headers handled incorrectly and did not make empty dict')
예제 #2
0
 def test_headers_to_dict(self):
     """Should parse headers into a dictionary."""
     result = headers_to_dict(MockHeaders([('Content-Type', 'application/json'), ('Set-Cookie', 'A=B'), ('Set-Cookie', 'C=D')]))
     self.assertEqual(result['Content-Type'], 'application/json','Single value for header was not assigned correctly')
     self.assertEqual(result['Set-Cookie'], ['A=B','C=D'],'Single value for header was not assigned correctly')