summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCristobal <cganterh@gmail.com>2015-03-02 21:00:03 -0300
committerCristobal <cganterh@gmail.com>2015-03-02 21:00:03 -0300
commit1cf37bd8f5ddc8ac629b07031f7c5341840b5b7e (patch)
tree7fcc9bd1a86db18b81645657585f01606edb388a
parent93ba12c7d7483af5374ba5f0e62a46ddc5e1ffe2 (diff)
downloadhttplib2-1cf37bd8f5ddc8ac629b07031f7c5341840b5b7e.tar.gz
Added unit test for _convert_byte_str in python3/httplib2test.py.
-rwxr-xr-xpython3/httplib2test.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/python3/httplib2test.py b/python3/httplib2test.py
index 5f786bd..246956a 100755
--- a/python3/httplib2test.py
+++ b/python3/httplib2test.py
@@ -1235,6 +1235,12 @@ class HttpPrivateTest(unittest.TestCase):
self.assertTrue('cache-control' in h)
self.assertTrue('other' in h)
self.assertEqual('Stuff', h['other'])
+
+ def testConvertByteStr(self):
+ with self.assertRaises(TypeError):
+ httplib2._convert_byte_str(4)
+ self.assertEqual('Hello World', httplib2._convert_byte_str(b'Hello World'))
+ self.assertEqual('Bye World', httplib2._convert_byte_str('Bye World'))
def testExpirationModelTransparent(self):
# Test that no-cache makes our request TRANSPARENT