コード例 #1
0
    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)
コード例 #2
0
    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)
コード例 #3
0
    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)
コード例 #4
0
ファイル: client.py プロジェクト: devopszone/sensu_st2_backup
    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)
コード例 #5
0
    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']
コード例 #6
0
    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')
コード例 #7
0
    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')
コード例 #8
0
 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()
コード例 #9
0
 def setUp(self):
     super(TestController, self).setUp()
     self.api = utils.FakeAPI(fixtures.data_fixtures)
     self.controller = artifacts.Controller(self.api)