File tree 4 files changed +32
-15
lines changed
4 files changed +32
-15
lines changed Original file line number Diff line number Diff line change 8
8
run3.py
9
9
* .orig
10
10
.eggs /*
11
- .cache /v /cache /lastfailed
12
- pylint_report.txt
11
+ .cache /v /cache /lastfailed
12
+ pylint_report.txt
13
13
.pypirc
14
+ .tox /*
15
+ .pytest_cache /*
Original file line number Diff line number Diff line change @@ -1001,15 +1001,15 @@ def test_APIGet(self):
1001
1001
response_obj = response .json ()
1002
1002
self .assertEqual (response_obj ['name' ], self .api_params ['wp_user' ])
1003
1003
1004
- class WPAPITestCasesBasic (WPAPITestCasesBase ):
1005
- def setUp (self ):
1006
- super (WPAPITestCasesBasic , self ).setUp ()
1007
- self .api_params .update ({
1008
- 'user_auth' : True ,
1009
- 'basic_auth' : True ,
1010
- 'query_string_auth' : False ,
1011
- })
1012
- self .wpapi = API (** self .api_params )
1004
+ # class WPAPITestCasesBasic(WPAPITestCasesBase):
1005
+ # def setUp(self):
1006
+ # super(WPAPITestCasesBasic, self).setUp()
1007
+ # self.api_params.update({
1008
+ # 'user_auth': True,
1009
+ # 'basic_auth': True,
1010
+ # 'query_string_auth': False,
1011
+ # })
1012
+ # self.wpapi = API(**self.api_params)
1013
1013
1014
1014
# class WPAPITestCasesBasicV1(WPAPITestCasesBase):
1015
1015
# def setUp(self):
Original file line number Diff line number Diff line change
1
+ # Tox (https://tox.readthedocs.io/) is a tool for running tests
2
+ # in multiple virtualenvs. This configuration file will run the
3
+ # test suite on all supported python versions. To use it, "pip install tox"
4
+ # and then run "tox" from this directory.
5
+
6
+ [tox]
7
+ envlist = py27, py36
8
+
9
+ [testenv]
10
+ deps =
11
+ -rrequirements.txt
12
+ -rrequirements-test.txt
13
+ commands =
14
+ pytest
Original file line number Diff line number Diff line change 8
8
9
9
# from requests import request
10
10
import logging
11
+ from six import text_type , u
11
12
from json import dumps as jsonencode
12
13
13
14
from wordpress .auth import BasicAuth , OAuth , OAuth_3Leg
@@ -164,12 +165,12 @@ def request_post_mortem(self, response=None):
164
165
header_url = StrUtils .eviscerate (header_url , '/' )
165
166
remedy = "try changing url to %s" % header_url
166
167
167
- msg = "API call to %s returned \n CODE: %s\n RESPONSE:%s \n HEADERS: %s\n REQ_BODY:%s" % (
168
+ msg = u "API call to %s returned \n CODE: %s\n RESPONSE:%s \n HEADERS: %s\n REQ_BODY:%s" % (
168
169
request_url ,
169
- str (response .status_code ),
170
+ text_type (response .status_code ),
170
171
UrlUtils .beautify_response (response ),
171
- str (response_headers ),
172
- str (request_body )[:1000 ]
172
+ text_type (response_headers ),
173
+ repr (request_body )[:1000 ]
173
174
)
174
175
if reason :
175
176
msg += "\n Because of %s" % reason
You can’t perform that action at this time.
0 commit comments