cic-internal-integration/apps/cic-ussd/tests/cic_ussd/metadata/test_custom.py

23 lines
914 B
Python
Raw Permalink Normal View History

2021-08-06 18:29:01 +02:00
# standard imports
import os
# external imports
2021-10-15 13:21:41 +02:00
from cic_types.condiments import MetadataPointer
2021-08-06 18:29:01 +02:00
from cic_types.processor import generate_metadata_pointer
# local imports
from cic_ussd.metadata import CustomMetadata
# test imports
def test_custom_metadata(activated_account, load_config, setup_metadata_request_handler, setup_metadata_signer):
2021-10-15 13:21:41 +02:00
cic_type = MetadataPointer.CUSTOM
identifier = bytes.fromhex(activated_account.blockchain_address)
2021-08-06 18:29:01 +02:00
custom_metadata_client = CustomMetadata(identifier)
assert custom_metadata_client.cic_type == cic_type
assert custom_metadata_client.engine == 'pgp'
assert custom_metadata_client.identifier == identifier
assert custom_metadata_client.metadata_pointer == generate_metadata_pointer(identifier, cic_type)
assert custom_metadata_client.url == os.path.join(
load_config.get('CIC_META_URL'), custom_metadata_client.metadata_pointer)