streamline configuration handling for test accounts, removing one layer of flags

This commit is contained in:
holger krekel
2022-05-01 15:28:23 +02:00
parent c1b33a66c4
commit 5e5710ecce
3 changed files with 53 additions and 35 deletions

View File

@@ -129,6 +129,8 @@ class Account(object):
namebytes = name.encode("utf8")
if namebytes == b"addr" and self.is_configured():
raise ValueError("can not change 'addr' after account is configured.")
if isinstance(value, (int, bool)):
value = str(int(value))
if value is not None:
valuebytes = value.encode("utf8")
else:
@@ -169,7 +171,7 @@ class Account(object):
:returns: None
"""
for key, value in kwargs.items():
self.set_config(key, str(value))
self.set_config(key, value)
def is_configured(self) -> bool:
""" determine if the account is configured already; an initial connection