Exemplo n.º 1
0
 def test_no_modify(self):
     headers = {b'key': b'val'}
     result = transport.clean_headers(headers)
     self.assertIsNot(result, headers)
     self.assertEqual(result, headers)
Exemplo n.º 2
0
 def test_unicode_failure(self):
     headers = {u'key': u'\u2603'}
     with self.assertRaises(client.NonAsciiHeaderError):
         transport.clean_headers(headers)
Exemplo n.º 3
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)
Exemplo n.º 4
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)
Exemplo n.º 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)
Exemplo n.º 6
0
 def test_unicode_failure(self):
     headers = {u'key': u'\u2603'}
     with self.assertRaises(client.NonAsciiHeaderError):
         transport.clean_headers(headers)
Exemplo n.º 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)
Exemplo n.º 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)