def test_no_modify(self):
     headers = {b'key': b'val'}
     result = transport.clean_headers(headers)
     self.assertIsNot(result, headers)
     self.assertEqual(result, headers)
 def test_unicode_failure(self):
     headers = {u'key': u'\u2603'}
     with self.assertRaises(client.NonAsciiHeaderError):
         transport.clean_headers(headers)
 def test_cast_object(self):
     headers = {b'key': True}
     header_str = {b'key': b'True'}
     result = transport.clean_headers(headers)
     self.assertIsNot(result, headers)
     self.assertEqual(result, header_str)
 def test_cast_unicode(self):
     headers = {u'key': u'val'}
     header_bytes = {b'key': b'val'}
     result = transport.clean_headers(headers)
     self.assertIsNot(result, headers)
     self.assertEqual(result, header_bytes)
Example #5
0
 def test_cast_object(self):
     headers = {b'key': True}
     header_str = {b'key': b'True'}
     result = transport.clean_headers(headers)
     self.assertIsNot(result, headers)
     self.assertEqual(result, header_str)
Example #6
0
 def test_unicode_failure(self):
     headers = {u'key': u'\u2603'}
     with self.assertRaises(client.NonAsciiHeaderError):
         transport.clean_headers(headers)
Example #7
0
 def test_cast_unicode(self):
     headers = {u'key': u'val'}
     header_bytes = {b'key': b'val'}
     result = transport.clean_headers(headers)
     self.assertIsNot(result, headers)
     self.assertEqual(result, header_bytes)
Example #8
0
 def test_no_modify(self):
     headers = {b'key': b'val'}
     result = transport.clean_headers(headers)
     self.assertIsNot(result, headers)
     self.assertEqual(result, headers)