for line in self.returned_obj.__iter__():
self.assertEqual(line, self.text)
-
class ProxyTests(unittest.TestCase):
def setUp(self):
self.assertEqual(DummyURLopener().open(
'spam://example/ /'),'//example/%20/')
+ # test the safe characters are not quoted by urlopen
+ self.assertEqual(DummyURLopener().open(
+ "spam://c:|windows%/:=&?~#+!$,;'@()*[]|/path/"),
+ "//c:|windows%/:=&?~#+!$,;'@()*[]|/path/")
+
# Just commented them out.
# Can't really tell why keep failing in windows and sparc.
# Everywhere else they work ok, but on those machines, someteimes
def open(self, fullurl, data=None):
"""Use URLopener().open(file) instead of open(file, 'r')."""
fullurl = unwrap(to_bytes(fullurl))
- fullurl = quote(fullurl, safe="%/:=&?~#+!$,;'@()*[]")
+ fullurl = quote(fullurl, safe="%/:=&?~#+!$,;'@()*[]|")
if self.tempcache and fullurl in self.tempcache:
filename, headers = self.tempcache[fullurl]
fp = open(filename, 'rb')