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

Unified Diff: Lib/test/test_urllib2.py

Issue 12614: Allow to explicitly set the method of urllib.request.Request
Patch Set: Created 1 year, 9 months ago
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Doc/library/urllib.request.rst ('k') | Lib/urllib/request.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_urllib2.py Wed Jul 27 01:22:41 2011 +0200
+++ b/Lib/test/test_urllib2.py Tue Jul 26 16:53:54 2011 -0700
@@ -1385,6 +1385,13 @@
self.assertEqual("POST", self.post.get_method())
self.assertEqual("GET", self.get.get_method())
+ # Test explicit method
+ req = Request("http://python.org", method="POST")
+ self.assertEqual("POST", req.get_method())
+
+ req = Request("http://python.org", data="data", method="PUT")
+ self.assertEqual("PUT", req.get_method())
+
def test_add_data(self):
self.assertFalse(self.get.has_data())
self.assertEqual("GET", self.get.get_method())
« no previous file with comments | « Doc/library/urllib.request.rst ('k') | Lib/urllib/request.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld cbc36f91f3f7