mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-12-24 09:20:04 -07:00
functional_tests: add wallet creation language tests
This commit is contained in:
parent
2d68b31f3e
commit
f8be31d269
@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
#encoding=utf-8
|
||||
|
||||
# Copyright (c) 2019 The Monero Project
|
||||
#
|
||||
@ -46,6 +47,7 @@ class WalletAddressTest():
|
||||
self.check_keys()
|
||||
self.create_subaddresses()
|
||||
self.open_close()
|
||||
self.languages()
|
||||
|
||||
def create(self):
|
||||
print 'Creating wallet'
|
||||
@ -176,6 +178,25 @@ class WalletAddressTest():
|
||||
res = wallet.get_address()
|
||||
assert res.address == '42ey1afDFnn4886T7196doS9GPMzexD9gXpsZJDwVjeRVdFCSoHnv7KPbBeGpzJBzHRCAs9UxqeoyFQMYbqSWYTfJJQAWDm'
|
||||
|
||||
def languages(self):
|
||||
print('Testing languages')
|
||||
wallet = Wallet()
|
||||
res = wallet.get_languages()
|
||||
assert 'English' in res.languages
|
||||
assert 'English' in res.languages_local
|
||||
assert 'Dutch' in res.languages
|
||||
assert 'Nederlands' in res.languages_local
|
||||
assert 'Japanese' in res.languages
|
||||
assert u'日本語' in res.languages_local
|
||||
try: wallet.close_wallet()
|
||||
except: pass
|
||||
languages = res.languages
|
||||
for language in languages:
|
||||
print 'Creating ' + str(language) + ' wallet'
|
||||
wallet.create_wallet(filename = '', language = language)
|
||||
res = wallet.query_key('mnemonic')
|
||||
wallet.close_wallet()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
WalletAddressTest().run_test()
|
||||
|
@ -125,13 +125,13 @@ class Wallet(object):
|
||||
}
|
||||
return self.rpc.send_json_rpc_request(describe_transfer)
|
||||
|
||||
def create_wallet(self, index=''):
|
||||
def create_wallet(self, filename='', password = '', language = 'English'):
|
||||
create_wallet = {
|
||||
'method': 'create_wallet',
|
||||
'params': {
|
||||
'filename': 'testWallet' + index,
|
||||
'password' : '',
|
||||
'language' : 'English'
|
||||
'filename': filename,
|
||||
'password': password,
|
||||
'language': language
|
||||
},
|
||||
'jsonrpc': '2.0',
|
||||
'id': '0'
|
||||
@ -623,6 +623,16 @@ class Wallet(object):
|
||||
}
|
||||
return self.rpc.send_json_rpc_request(relay_tx)
|
||||
|
||||
def get_languages(self):
|
||||
get_languages = {
|
||||
'method': 'get_languages',
|
||||
'params': {
|
||||
},
|
||||
'jsonrpc': '2.0',
|
||||
'id': '0'
|
||||
}
|
||||
return self.rpc.send_json_rpc_request(get_languages)
|
||||
|
||||
def get_version(self):
|
||||
get_version = {
|
||||
'method': 'get_version',
|
||||
|
Loading…
Reference in New Issue
Block a user