Skip to content

Commit e263a34

Browse files
committed
test: rpc_users: Make variable names more clear.
1 parent 830dc2d commit e263a34

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/functional/rpc_users.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ def set_test_params(self):
3939
def setup_chain(self):
4040
super().setup_chain()
4141
#Append rpcauth to bitcoin.conf before initialization
42+
self.rtpassword = "cA773lm788buwYe4g4WT+05pKyNruVKjQ25x3n0DQcM="
4243
rpcauth = "rpcauth=rt:93648e835a54c573682c2eb19f882535$7681e9c5b74bdd85e78166031d2058e1069b3ed7ed967c93fc63abba06f31144"
43-
rpcuser = "rpcuser=rpcuser💻"
44-
rpcpassword = "rpcpassword=rpcpassword🔑"
44+
45+
self.rpcuser = "rpcuser💻"
46+
self.rpcpassword = "rpcpassword🔑"
4547

4648
config = configparser.ConfigParser()
4749
config.read_file(open(self.options.configfile))
@@ -65,8 +67,8 @@ def setup_chain(self):
6567
f.write(rpcauth2+"\n")
6668
f.write(rpcauth3+"\n")
6769
with open(os.path.join(get_datadir_path(self.options.tmpdir, 1), "bitcoin.conf"), 'a', encoding='utf8') as f:
68-
f.write(rpcuser+"\n")
69-
f.write(rpcpassword+"\n")
70+
f.write("rpcuser={}\n".format(self.rpcuser))
71+
f.write("rpcpassword={}\n".format(self.rpcpassword))
7072

7173
def test_auth(self, node, user, password):
7274
self.log.info('Correct...')
@@ -88,10 +90,8 @@ def run_test(self):
8890
##################################################
8991
url = urllib.parse.urlparse(self.nodes[0].url)
9092

91-
password = "cA773lm788buwYe4g4WT+05pKyNruVKjQ25x3n0DQcM="
92-
9393
self.test_auth(self.nodes[0], url.username, url.password)
94-
self.test_auth(self.nodes[0], 'rt', password)
94+
self.test_auth(self.nodes[0], 'rt', self.rtpassword)
9595
self.test_auth(self.nodes[0], 'rt2', self.rt2password)
9696
self.test_auth(self.nodes[0], self.user, self.password)
9797

@@ -100,7 +100,7 @@ def run_test(self):
100100
###############################################################
101101
url = urllib.parse.urlparse(self.nodes[1].url)
102102

103-
self.test_auth(self.nodes[1], "rpcuser💻", "rpcpassword🔑")
103+
self.test_auth(self.nodes[1], self.rpcuser, self.rpcpassword)
104104

105105
if __name__ == '__main__':
106106
HTTPBasicsTest ().main ()

0 commit comments

Comments
 (0)