[wwwsearch-commits] r51829 - wwwsearch/mechanize/trunk/test

jjlee at codespeak.net jjlee at codespeak.net
Sat Feb 23 21:56:33 CET 2008


Author: jjlee
Date: Sat Feb 23 21:56:31 2008
New Revision: 51829

Modified:
   wwwsearch/mechanize/trunk/test/test_cookies.py
Log:
Stop tests from clobbering files that happen to be lying around in cwd (!)

Modified: wwwsearch/mechanize/trunk/test/test_cookies.py
==============================================================================
--- wwwsearch/mechanize/trunk/test/test_cookies.py	(original)
+++ wwwsearch/mechanize/trunk/test/test_cookies.py	Sat Feb 23 21:56:31 2008
@@ -118,7 +118,7 @@
 
         # missing = sign in Cookie: header is regarded by Mozilla as a missing
         # NAME.  WE regard it as a missing VALUE.
-        filename = os.path.abspath("cookies2.txt")
+        filename = tempfile.mktemp()
         c = MozillaCookieJar(filename)
         interact_netscape(c, "http://www.acme.com/", 'eggs')
         interact_netscape(c, "http://www.acme.com/", '"spam"; path=/foo/')
@@ -1262,7 +1262,7 @@
         assert len(c) == 6
 
         # save and restore
-        filename = "lwp-cookies.txt"
+        filename = tempfile.mktemp()
 
         try:
             c.save(filename, ignore_discard=True)
@@ -1306,7 +1306,7 @@
 
         year_plus_one = localtime(time.time())[0] + 1
 
-        filename = "cookies.txt"
+        filename = tempfile.mktemp()
 
         c = MozillaCookieJar(filename,
                              policy=DefaultCookiePolicy(rfc2965=True))


More information about the wwwsearch-commits mailing list