File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,31 @@ def woo_test_mock(*args, **kwargs):
79
79
status = self .api .get ("products" ).status_code
80
80
self .assertEqual (status , 200 )
81
81
82
+ def test_get_with_parameters (self ):
83
+ """ Test GET requests w/ url params """
84
+ @all_requests
85
+ def woo_test_mock (* args , ** kwargs ):
86
+ return {'status_code' : 200 ,
87
+ 'content' : 'OK' }
88
+
89
+ with HTTMock (woo_test_mock ):
90
+ # call requests
91
+ status = self .api .get ("products" , params = {'sku' : 10001 }).status_code
92
+ self .assertEqual (status , 200 )
93
+
94
+ def test_get_with_requests_kwargs (self ):
95
+ """ Test GET requests w/ optional requests-module kwargs """
96
+
97
+ @all_requests
98
+ def woo_test_mock (* args , ** kwargs ):
99
+ return {'status_code' : 200 ,
100
+ 'content' : 'OK' }
101
+
102
+ with HTTMock (woo_test_mock ):
103
+ # call requests
104
+ status = self .api .get ("products" , timeout = 60 , allow_redirects = True ).status_code
<
51EC
/code>
105
+ self .assertEqual (status , 200 )
106
+
82
107
def test_post (self ):
83
108
""" Test POST requests """
84
109
@all_requests
You can’t perform that action at this time.
0 commit comments