def _get_instance_uuid(self):
     single_result = self.repository.list(
         subpath="/hbp/core/schematest/v0.0.1", size=1, deprecated=None)
     instance = single_result.results[0]
     return InstanceRepository._extract_uuid(instance.result_id)
Beispiel #2
0
test_schema_obj = Schema.create_new(organisation_name, domain_name,
                                    schema_name, version, test_schema)
schema_repo = SchemaRepository(nar_client)
schema_repo.create(test_schema_obj)
schema_repo.publish(test_schema_obj, True)

#
# Read a schema
#
testschema_read = schema_repo.read(organisation_name, domain_name, schema_name,
                                   version)
print(testschema_read)

#
# 5. Create a test instance. (test0)
# TODO
test_instance = {}
#
from pyxus.resources.repository import InstanceRepository
from pyxus.resources.entity import Instance

# Create an instance of naro/tests/testschema (v0.0.2)
instance_repo = InstanceRepository(nar_client)
test0 = Instance.create_new(organisation_name, domain_name, schema_name,
                            version, test_instance)
instance_repo.create(test0)
# get uuid
single_result = instance_repo.list(subpath=fpath, size=1, deprecated=None)
instance = single_result.results[0]
InstanceRepository._extract_uuid(instance.result_id)