def __init__(self, endpoint, **kwargs): endpoint, version = utils.strip_version(endpoint) self.version = version or 2.0 self.http_client = http.HTTPClient(endpoint, **kwargs) self.schemas = schemas.Controller(self.http_client) self.images = images.Controller(self.http_client, self.schemas) self.image_tags = image_tags.Controller(self.http_client, self.schemas) self.image_members = image_members.Controller(self.http_client, self.schemas) self.tasks = tasks.Controller(self.http_client, self.schemas) self.metadefs_resource_type = (metadefs.ResourceTypeController( self.http_client, self.schemas)) self.metadefs_property = (metadefs.PropertyController( self.http_client, self.schemas)) self.metadefs_object = (metadefs.ObjectController( self.http_client, self.schemas)) self.metadefs_namespace = (metadefs.NamespaceController( self.http_client, self.schemas))
def __init__(self, endpoint=None, **kwargs): endpoint, self.version = utils.endpoint_version_from_url(endpoint, 2.0) self.http_client = http.get_http_client(endpoint=endpoint, **kwargs) self.schemas = schemas.Controller(self.http_client) self.images = images.Controller(self.http_client, self.schemas) self.image_tags = image_tags.Controller(self.http_client, self.schemas) self.image_members = image_members.Controller(self.http_client, self.schemas) self.tasks = tasks.Controller(self.http_client, self.schemas) self.metadefs_resource_type = (metadefs.ResourceTypeController( self.http_client, self.schemas)) self.metadefs_property = (metadefs.PropertyController( self.http_client, self.schemas)) self.metadefs_object = (metadefs.ObjectController( self.http_client, self.schemas)) self.metadefs_tag = (metadefs.TagController(self.http_client, self.schemas)) self.metadefs_namespace = (metadefs.NamespaceController( self.http_client, self.schemas)) self.versions = versions.VersionController(self.http_client)
def setUp(self): super(TestObjectController, self).setUp() self.api = utils.FakeAPI(data_fixtures) self.schema_api = utils.FakeSchemaAPI(schema_fixtures) self.controller = metadefs.ObjectController(self.api, self.schema_api)