Exemple #1
0
def test_keyname(tmpdir):
    key = Key()
    data = 'foobar'
    key.create(data)
    assert key.g_backend == 'sha256'.upper()
    assert key.g_name == 'c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2'
    assert key.keyname(
    ) == 'SHA256-s6--c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2'
Exemple #2
0
def test_keypath():
    key = Key()
    keyname = 'SHA256-s6--c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2'
    key.keypath(keyname)
    assert key.keypath(keyname) == '11d/8ca/'