aboutsummaryrefslogtreecommitdiff
path: root/tests/functional_tests/wallet_address.py
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2019-04-11 13:14:44 +0200
committerRiccardo Spagni <ric@spagni.net>2019-04-11 13:14:44 +0200
commit083271375ae14bf8b3495c9c3f4490ae29cb9905 (patch)
treef384a6e92c3dbb40c8644275fa121b699b2ce7a6 /tests/functional_tests/wallet_address.py
parentMerge pull request #5411 (diff)
parentconsole: simple shell over console.py (diff)
downloadmonero-083271375ae14bf8b3495c9c3f4490ae29cb9905.tar.xz
Merge pull request #5383
0575794f console: simple shell over console.py (moneromooo-monero) 047af5c3 console.py: can now connect to several daemons/wallets (moneromooo-monero) 9f9571aa cmake: always detect python, it's neeed for some tests (moneromooo-monero) 8646bd00 functional_tests: exit with 1 if any test fails (moneromooo-monero) 6fd8834d console.py: add tab completion (moneromooo-monero) 04a20cb2 functional_tests: cold signing key images/outputs import/export (moneromooo-monero) 798e3cad functional_tests: add double spend detection tests (moneromooo-monero) 7c657bb2 functional_tests: add alt chains tests (moneromooo-monero) f8be31d2 functional_tests: add wallet creation language tests (moneromooo-monero) 2d68b31f functional_tests: add more wallet tests (moneromooo-monero) 23f86dad python-rpc: add set_log_level and set_log_categories (moneromooo-monero) b3a32d55 functional_tests: add describe_transfer tests (moneromooo-monero) 108f4375 console.py: support connecting to any host, not just 127.0.0.1 (moneromooo-monero) 064ab123 functional_tests: add more blockchain related tests (moneromooo-monero) 21b1ac1d functional_tests: add bans tests (moneromooo-monero)
Diffstat (limited to 'tests/functional_tests/wallet_address.py')
-rwxr-xr-xtests/functional_tests/wallet_address.py50
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/functional_tests/wallet_address.py b/tests/functional_tests/wallet_address.py
index 66a1633ca..cb9c52e7a 100755
--- a/tests/functional_tests/wallet_address.py
+++ b/tests/functional_tests/wallet_address.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python3
+#encoding=utf-8
# Copyright (c) 2019 The Monero Project
#
@@ -45,6 +46,8 @@ class WalletAddressTest():
self.check_main_address()
self.check_keys()
self.create_subaddresses()
+ self.open_close()
+ self.languages()
def create(self):
print 'Creating wallet'
@@ -148,5 +151,52 @@ class WalletAddressTest():
res = wallet.get_address_index('82pP87g1Vkd3LUMssBCumk3MfyEsFqLAaGDf6oxddu61EgSFzt8gCwUD4tr3kp9TUfdPs2CnpD7xLZzyC1Ei9UsW3oyCWDf')
assert res.index == {'major': 1, 'minor': 0}
+ def open_close(self):
+ print 'Testing open/close'
+ wallet = Wallet()
+
+ res = wallet.get_address()
+ assert res.address == '42ey1afDFnn4886T7196doS9GPMzexD9gXpsZJDwVjeRVdFCSoHnv7KPbBeGpzJBzHRCAs9UxqeoyFQMYbqSWYTfJJQAWDm'
+
+ wallet.close_wallet()
+ ok = False
+ try: res = wallet.get_address()
+ except: ok = True
+ assert ok
+
+ wallet.restore_deterministic_wallet(seed = 'peeled mixture ionic radar utopia puddle buying illness nuns gadget river spout cavernous bounced paradise drunk looking cottage jump tequila melting went winter adjust spout')
+ res = wallet.get_address()
+ assert res.address == '44Kbx4sJ7JDRDV5aAhLJzQCjDz2ViLRduE3ijDZu3osWKBjMGkV1XPk4pfDUMqt1Aiezvephdqm6YD19GKFD9ZcXVUTp6BW'
+
+ wallet.close_wallet()
+ ok = False
+ try: wallet.get_address()
+ except: ok = True
+ assert ok
+
+ wallet.restore_deterministic_wallet(seed = 'velvet lymph giddy number token physics poetry unquoted nibs useful sabotage limits benches lifestyle eden nitrogen anvil fewest avoid batch vials washing fences goat unquoted')
+ 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()