[qa] py2: Unfiddle strings into bytes explicitly
Github-Pull: #7853 Rebased-From:faa41ee204,fa7abe0a00Conflicts: qa/rpc-tests/invalidtxrequest.py qa/rpc-tests/p2p-feefilter.py qa/rpc-tests/proxy_test.py qa/rpc-tests/test_framework/mininode.py qa/rpc-tests/test_framework/netutil.py src/test/bctest.py
This commit is contained in:
@@ -53,7 +53,7 @@ class HTTPBasicsTest (BitcoinTestFramework):
|
||||
password2 = "8/F3uMDw4KSEbw96U3CA1C4X05dkHDN2BPFjTgZW4KI="
|
||||
authpairnew = "rt:"+password
|
||||
|
||||
headers = {"Authorization": "Basic " + base64.b64encode(authpair)}
|
||||
headers = {"Authorization": "Basic " + str_to_b64str(authpair)}
|
||||
|
||||
conn = httplib.HTTPConnection(url.hostname, url.port)
|
||||
conn.connect()
|
||||
@@ -63,7 +63,7 @@ class HTTPBasicsTest (BitcoinTestFramework):
|
||||
conn.close()
|
||||
|
||||
#Use new authpair to confirm both work
|
||||
headers = {"Authorization": "Basic " + base64.b64encode(authpairnew)}
|
||||
headers = {"Authorization": "Basic " + str_to_b64str(authpairnew)}
|
||||
|
||||
conn = httplib.HTTPConnection(url.hostname, url.port)
|
||||
conn.connect()
|
||||
@@ -74,7 +74,7 @@ class HTTPBasicsTest (BitcoinTestFramework):
|
||||
|
||||
#Wrong login name with rt's password
|
||||
authpairnew = "rtwrong:"+password
|
||||
headers = {"Authorization": "Basic " + base64.b64encode(authpairnew)}
|
||||
headers = {"Authorization": "Basic " + str_to_b64str(authpairnew)}
|
||||
|
||||
conn = httplib.HTTPConnection(url.hostname, url.port)
|
||||
conn.connect()
|
||||
@@ -85,7 +85,7 @@ class HTTPBasicsTest (BitcoinTestFramework):
|
||||
|
||||
#Wrong password for rt
|
||||
authpairnew = "rt:"+password+"wrong"
|
||||
headers = {"Authorization": "Basic " + base64.b64encode(authpairnew)}
|
||||
headers = {"Authorization": "Basic " + str_to_b64str(authpairnew)}
|
||||
|
||||
conn = httplib.HTTPConnection(url.hostname, url.port)
|
||||
conn.connect()
|
||||
@@ -96,7 +96,7 @@ class HTTPBasicsTest (BitcoinTestFramework):
|
||||
|
||||
#Correct for rt2
|
||||
authpairnew = "rt2:"+password2
|
||||
headers = {"Authorization": "Basic " + base64.b64encode(authpairnew)}
|
||||
headers = {"Authorization": "Basic " + str_to_b64str(authpairnew)}
|
||||
|
||||
conn = httplib.HTTPConnection(url.hostname, url.port)
|
||||
conn.connect()
|
||||
@@ -107,7 +107,7 @@ class HTTPBasicsTest (BitcoinTestFramework):
|
||||
|
||||
#Wrong password for rt2
|
||||
authpairnew = "rt2:"+password2+"wrong"
|
||||
headers = {"Authorization": "Basic " + base64.b64encode(authpairnew)}
|
||||
headers = {"Authorization": "Basic " + str_to_b64str(authpairnew)}
|
||||
|
||||
conn = httplib.HTTPConnection(url.hostname, url.port)
|
||||
conn.connect()
|
||||
@@ -117,6 +117,5 @@ class HTTPBasicsTest (BitcoinTestFramework):
|
||||
conn.close()
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
HTTPBasicsTest ().main ()
|
||||
|
||||
Reference in New Issue
Block a user