mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
[qa] py2: Unfiddle strings into bytes explicitly
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