def import_signing_profile(self, profile_name: str, private_key: SqueakPrivateKey) -> int: squeak_profile = create_signing_profile( profile_name, private_key, ) profile_id = self.squeak_db.insert_profile(squeak_profile) self.create_update_subscriptions_event() return profile_id
def create_signing_profile(self, profile_name: str) -> int: squeak_profile = create_signing_profile(profile_name, ) profile_id = self.squeak_db.insert_profile(squeak_profile) self.create_update_subscriptions_event() return profile_id
def test_import_signing_profile(profile_name, private_key, public_key): profile = create_signing_profile(profile_name, private_key) assert profile.profile_name == profile_name assert profile.private_key == private_key assert profile.public_key == public_key
def test_create_signing_profile_empty_name(): with pytest.raises(Exception) as excinfo: create_signing_profile("") assert "Profile name cannot be empty." in str(excinfo.value)
def test_create_signing_profile(profile_name): profile = create_signing_profile(profile_name) assert profile.profile_name == profile_name
def test_import_signing_profile(profile_name, private_key, address_str): profile = create_signing_profile(profile_name, private_key) assert profile.profile_name == profile_name assert profile.private_key == private_key.encode() assert profile.address == address_str
def gen_signing_profile(profile_name, signing_key): return create_signing_profile( profile_name, signing_key, )