diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-05-02 12:18:28 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-09-17 11:38:25 +0000 |
commit | 4c375c9442a1eb481310914f37146c0dd5b28cf2 (patch) | |
tree | 0b71b410332ddbc5eb8849a36a5dd32188f3c444 /tests/functional_tests/wallet.py | |
parent | functional_tests: add rescan_spent/rescan_blockchain tests (diff) | |
download | monero-4c375c9442a1eb481310914f37146c0dd5b28cf2.tar.xz |
functional_tests: add wallet attributes test
Diffstat (limited to 'tests/functional_tests/wallet.py')
-rwxr-xr-x | tests/functional_tests/wallet.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/functional_tests/wallet.py b/tests/functional_tests/wallet.py index e291376ff..2240f96ec 100755 --- a/tests/functional_tests/wallet.py +++ b/tests/functional_tests/wallet.py @@ -47,6 +47,7 @@ class WalletTest(): self.check_keys() self.create_subaddresses() self.tags() + self.attributes() self.open_close() self.languages() self.change_password() @@ -253,6 +254,28 @@ class WalletTest(): subaddress_accounts.append((x.account_index, x.base_address, x.label)) assert sorted(subaddress_accounts) == [(0, '42ey1afDFnn4886T7196doS9GPMzexD9gXpsZJDwVjeRVdFCSoHnv7KPbBeGpzJBzHRCAs9UxqeoyFQMYbqSWYTfJJQAWDm', 'main'), (1, '82pP87g1Vkd3LUMssBCumk3MfyEsFqLAaGDf6oxddu61EgSFzt8gCwUD4tr3kp9TUfdPs2CnpD7xLZzyC1Ei9UsW3oyCWDf', 'idx1_new')] + def attributes(self): + print 'Testing attributes' + wallet = Wallet() + + ok = False + try: res = wallet.get_attribute('foo') + except: ok = True + assert ok + res = wallet.set_attribute('foo', 'bar') + res = wallet.get_attribute('foo') + assert res.value == 'bar' + res = wallet.set_attribute('foo', 'いっしゅん') + res = wallet.get_attribute('foo') + assert res.value == u'いっしゅん' + ok = False + try: res = wallet.get_attribute('いちりゅう') + except: ok = True + assert ok + res = wallet.set_attribute('いちりゅう', 'いっぽう') + res = wallet.get_attribute('いちりゅう') + assert res.value == u'いっぽう' + def open_close(self): print('Testing open/close') wallet = Wallet() |