Skip to content

Commit 1cf37bd

Browse files
committed
Added unit test for _convert_byte_str in python3/httplib2test.py.
1 parent 93ba12c commit 1cf37bd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

python3/httplib2test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,6 +1235,12 @@ def testNormalizeHeaders(self):
12351235
self.assertTrue('cache-control' in h)
12361236
self.assertTrue('other' in h)
12371237
self.assertEqual('Stuff', h['other'])
1238+
1239+
def testConvertByteStr(self):
1240+
with self.assertRaises(TypeError):
1241+
httplib2._convert_byte_str(4)
1242+
self.assertEqual('Hello World', httplib2._convert_byte_str(b'Hello World'))
1243+
self.assertEqual('Bye World', httplib2._convert_byte_str('Bye World'))
12381244

12391245
def testExpirationModelTransparent(self):
12401246
# Test that no-cache makes our request TRANSPARENT

0 commit comments

Comments
 (0)