aboutsummaryrefslogtreecommitdiff
path: root/test/functional/rpc_users.py
diff options
context:
space:
mode:
authorCarl Dong <contact@carldong.me>2019-07-04 12:41:34 -0400
committerCarl Dong <contact@carldong.me>2019-07-08 16:13:35 -0400
commite263a343d4b6a2622df6bb734cd9d51a0d20a663 (patch)
tree42bb1d040f087c374044ddb8a997927b6f031830 /test/functional/rpc_users.py
parent830dc2dd0fccb7f3ec49ff7233a188d92c541e7e (diff)
downloadbitcoin-e263a343d4b6a2622df6bb734cd9d51a0d20a663.tar.xz
test: rpc_users: Make variable names more clear.
Diffstat (limited to 'test/functional/rpc_users.py')
-rwxr-xr-xtest/functional/rpc_users.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/functional/rpc_users.py b/test/functional/rpc_users.py
index 2d06c95497..8bbb3c04fa 100755
--- a/test/functional/rpc_users.py
+++ b/test/functional/rpc_users.py
@@ -39,9 +39,11 @@ class HTTPBasicsTest(BitcoinTestFramework):
def setup_chain(self):
super().setup_chain()
#Append rpcauth to bitcoin.conf before initialization
+ self.rtpassword = "cA773lm788buwYe4g4WT+05pKyNruVKjQ25x3n0DQcM="
rpcauth = "rpcauth=rt:93648e835a54c573682c2eb19f882535$7681e9c5b74bdd85e78166031d2058e1069b3ed7ed967c93fc63abba06f31144"
- rpcuser = "rpcuser=rpcuser💻"
- rpcpassword = "rpcpassword=rpcpassword🔑"
+
+ self.rpcuser = "rpcuser💻"
+ self.rpcpassword = "rpcpassword🔑"
config = configparser.ConfigParser()
config.read_file(open(self.options.configfile))
@@ -65,8 +67,8 @@ class HTTPBasicsTest(BitcoinTestFramework):
f.write(rpcauth2+"\n")
f.write(rpcauth3+"\n")
with open(os.path.join(get_datadir_path(self.options.tmpdir, 1), "bitcoin.conf"), 'a', encoding='utf8') as f:
- f.write(rpcuser+"\n")
- f.write(rpcpassword+"\n")
+ f.write("rpcuser={}\n".format(self.rpcuser))
+ f.write("rpcpassword={}\n".format(self.rpcpassword))
def test_auth(self, node, user, password):
self.log.info('Correct...')
@@ -88,10 +90,8 @@ class HTTPBasicsTest(BitcoinTestFramework):
##################################################
url = urllib.parse.urlparse(self.nodes[0].url)
- password = "cA773lm788buwYe4g4WT+05pKyNruVKjQ25x3n0DQcM="
-
self.test_auth(self.nodes[0], url.username, url.password)
- self.test_auth(self.nodes[0], 'rt', password)
+ self.test_auth(self.nodes[0], 'rt', self.rtpassword)
self.test_auth(self.nodes[0], 'rt2', self.rt2password)
self.test_auth(self.nodes[0], self.user, self.password)
@@ -100,7 +100,7 @@ class HTTPBasicsTest(BitcoinTestFramework):
###############################################################
url = urllib.parse.urlparse(self.nodes[1].url)
- self.test_auth(self.nodes[1], "rpcuser💻", "rpcpassword🔑")
+ self.test_auth(self.nodes[1], self.rpcuser, self.rpcpassword)
if __name__ == '__main__':
HTTPBasicsTest ().main ()