示例#1
0
 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
示例#2
0
 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
示例#3
0
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
示例#4
0
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)
示例#5
0
def test_create_signing_profile(profile_name):
    profile = create_signing_profile(profile_name)

    assert profile.profile_name == profile_name
示例#6
0
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
示例#7
0
def gen_signing_profile(profile_name, signing_key):
    return create_signing_profile(
        profile_name,
        signing_key,
    )