def test_get_or_create(self): """ Checks if the singleton is handled properly. It should only be different when changing keystore_dir. """ account_utils = AccountUtils.get_or_create(self.keystore_dir) assert account_utils == AccountUtils.get_or_create(self.keystore_dir) with TemporaryDirectory() as keystore_dir: assert account_utils != AccountUtils.get_or_create(keystore_dir) assert AccountUtils.get_or_create(keystore_dir) == \ AccountUtils.get_or_create(keystore_dir)
def account_utils(self): """Gets or creates the AccountUtils object so it loads lazily.""" from etherollapp.ethereum_utils import AccountUtils keystore_dir = Settings.get_keystore_path() return AccountUtils.get_or_create(keystore_dir)
def account_utils(self): """ Gets or creates the AccountUtils object so it loads lazily. """ keystore_dir = Settings.get_keystore_path() return AccountUtils.get_or_create(keystore_dir)