def setUp(self): super(TestReactivateArtifacts, self).setUp() self.artifact_mock.call.return_value = \ api_art.Controller(self.http, type_name='images') # Command to test self.cmd = osc_art.ReactivateArtifact(self.app, None)
def setUp(self): super(TypeSchema, self).setUp() self.artifact_mock.call.return_value = \ api_art.Controller(self.http, type_name='images') # Command to test self.cmd = osc_art.TypeSchema(self.app, None)
def setUp(self): super(TestRemoveLocation, self).setUp() self.blob_mock.call.return_value = \ api_art.Controller(self.http, type_name='images') # Command to test self.cmd = osc_blob.RemoveLocation(self.app, None)
def __init__(self, endpoint, **kwargs): """Initialize a new client for the Glare v1 API.""" self.version = kwargs.get('version') self.http_client = http.construct_http_client(endpoint, **kwargs) self.artifacts = artifacts.Controller(self.http_client) self.versions = versions.VersionController(self.http_client)
def setUp(self): super(TestListArtifacts, self).setUp() self.artifact_mock.call.return_value = \ api_art.Controller(self.http, type_name='images') # Command to test self.cmd = osc_art.ListArtifacts(self.app, None) self.COLUMNS = ['Id', 'Name', 'Version', 'Owner', 'Visibility', 'Status']
def setUp(self): super(TestAddLocation, self).setUp() self.blob_mock.call.return_value = \ api_art.Controller(self.http, type_name='images') # Command to test self.cmd = osc_blob.AddLocation(self.app, None) self.COLUMNS = ('blob_property', 'content_type', 'external', 'md5', 'sha1', 'sha256', 'size', 'status', 'url')
def setUp(self): super(TestDownloadBlob, self).setUp() self.blob_mock.call.return_value = \ api_art.Controller(self.http, type_name='images') # Command to test self.cmd = osc_blob.DownloadBlob(self.app, None) self.COLUMNS = ('blob_property', 'id', 'name', 'size', 'status', 'version')
def setUp(self): self.mock_resp = mock.MagicMock() self.mock_body = mock.MagicMock() self.mock_http_client = mock.MagicMock() for method in ('get', 'post', 'patch', 'delete'): method = getattr(self.mock_http_client, method) method.return_value = (self.mock_resp, self.mock_body) self.c = artifacts.Controller(self.mock_http_client, 'test_name') self.c._check_type_name = mock.Mock(return_value='checked_name') super(TestController, self).setUp()
def setUp(self): super(TestController, self).setUp() self.api = utils.FakeAPI(fixtures.data_fixtures) self.controller = artifacts.Controller(self.api)