Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(8)

Side by Side Diff: Lib/test/test_http_cookiejar.py

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/test/test_glob.py ('k') | Lib/test/test_import.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 """Tests for http/cookiejar.py.""" 1 """Tests for http/cookiejar.py."""
2 2
3 import os 3 import os
4 import re 4 import re
5 import test.support 5 import test.support
6 import time 6 import time
7 import unittest 7 import unittest
8 import urllib.request 8 import urllib.request
9 9
10 from http.cookiejar import (time2isoz, http2time, time2netscape, 10 from http.cookiejar import (time2isoz, http2time, time2netscape,
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 def test_bad_magic(self): 250 def test_bad_magic(self):
251 # IOErrors (eg. file doesn't exist) are allowed to propagate 251 # IOErrors (eg. file doesn't exist) are allowed to propagate
252 filename = test.support.TESTFN 252 filename = test.support.TESTFN
253 for cookiejar_class in LWPCookieJar, MozillaCookieJar: 253 for cookiejar_class in LWPCookieJar, MozillaCookieJar:
254 c = cookiejar_class() 254 c = cookiejar_class()
255 try: 255 try:
256 c.load(filename="for this test to work, a file with this " 256 c.load(filename="for this test to work, a file with this "
257 "filename should not exist") 257 "filename should not exist")
258 except IOError as exc: 258 except IOError as exc:
259 # exactly IOError, not LoadError 259 # exactly IOError, not LoadError
260 self.assertIs(exc.__class__, IOError) 260 self.assertEqual(exc.__class__, IOError)
261 else: 261 else:
262 self.fail("expected IOError for invalid filename") 262 self.fail("expected IOError for invalid filename")
263 # Invalid contents of cookies file (eg. bad magic string) 263 # Invalid contents of cookies file (eg. bad magic string)
264 # causes a LoadError. 264 # causes a LoadError.
265 try: 265 try:
266 with open(filename, "w") as f: 266 with open(filename, "w") as f:
267 f.write("oops\n") 267 f.write("oops\n")
268 for cookiejar_class in LWPCookieJar, MozillaCookieJar: 268 for cookiejar_class in LWPCookieJar, MozillaCookieJar:
269 c = cookiejar_class() 269 c = cookiejar_class()
270 self.assertRaises(LoadError, c.load, filename) 270 self.assertRaises(LoadError, c.load, filename)
(...skipping 1381 matching lines...) Expand 10 before | Expand all | Expand 10 after
1652 test.support.run_unittest( 1652 test.support.run_unittest(
1653 DateTimeTests, 1653 DateTimeTests,
1654 HeaderTests, 1654 HeaderTests,
1655 CookieTests, 1655 CookieTests,
1656 FileCookieJarTests, 1656 FileCookieJarTests,
1657 LWPCookieTests, 1657 LWPCookieTests,
1658 ) 1658 )
1659 1659
1660 if __name__ == "__main__": 1660 if __name__ == "__main__":
1661 test_main(verbose=True) 1661 test_main(verbose=True)
OLDNEW
« no previous file with comments | « Lib/test/test_glob.py ('k') | Lib/test/test_import.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+