Browse Source

Replace method name to be more meanful

and improve test assertions
master
juga 1 year ago
parent
commit
561d0c54e7
2 changed files with 7 additions and 9 deletions
  1. +2
    -2
      pygnunetrest/gnunetrest.py
  2. +5
    -7
      tests/test_gnunet.py

+ 2
- 2
pygnunetrest/gnunetrest.py View File

@ -44,7 +44,7 @@ class GNUnetRest:
r = requests.get(self.identity_name + key_hash)
return r.json()['pubkey'] if r.ok else (False, r.reason)
def fetch_identity_namestore(self):
def fetch_namestore_default_identity(self):
"""Returns the default identity of subsystem 'namestore'."""
r = requests.get(self.identity_namestore)
return r.json()['name'] if r.ok else (False, r.reason)
@ -73,7 +73,7 @@ class GNUnetRest:
# Namestore Section
def set_namestore_identity(self, identity_name):
def set_namestore_default_identity(self, identity_name):
"""Sets the default Identity for subsystem 'namestore'.
Returns True if successful tuple if not.


+ 5
- 7
tests/test_gnunet.py View File

@ -60,15 +60,13 @@ def test_delete_identity():
# # NAMESTORE#
# # =========#
def test_set_namestore_identity():
REST_CLIENT.create_identity("alice")
assert REST_CLIENT.set_namestore_identity("alice")
def test_set_namestore_default_identity():
assert REST_CLIENT.set_namestore_default_identity("alice") is True
def test_list_namestore_entry():
assert REST_CLIENT.set_namestore_identity("alice")
r = REST_CLIENT.list_namestore_entries("alice")
print(r)
def test_fetch_namestore_default_identity():
r = REST_CLIENT.fetch_namestore_default_identity()
assert "alice" == r
def test_add_namestore_entry():


Loading…
Cancel
Save