Esempio n. 1
0
    def setUp(self):
        def get_client(*_):
            creds = SharedKeyCredentials('test1', 'ZmFrZV9hY29jdW50X2tleQ==')
            return BatchServiceClient(creds,
                                      'https://test1.westus.batch.azure.com/')

        self.command_pool = _command_type.AzureBatchDataPlaneCommand(
            'batch_tests_pool',
            'azure.batch.operations.pool_operations#PoolOperations.add',
            operations.pool_operations.PoolOperations.add,
            client_factory=get_client)
        self.command_node = _command_type.AzureBatchDataPlaneCommand(
            'batch_tests_node',
            'azure.batch.operations.compute_node_operations#ComputeNodeOperations.reboot',
            operations.compute_node_operations.ComputeNodeOperations.reboot,
            client_factory=get_client)
        self.command_job = _command_type.AzureBatchDataPlaneCommand(
            'batch_tests_job',
            'azure.batch.operations.job_operations#JobOperations.add',
            operations.job_operations.JobOperations.add,
            client_factory=get_client)
        self.command_task = _command_type.AzureBatchDataPlaneCommand(
            'batch_tests_task',
            'azure.batch.operations.task_operations#TaskOperations.add',
            operations.task_operations.TaskOperations.add,
            client_factory=get_client,
            flatten=1)
        self.command_file = _command_type.AzureBatchDataPlaneCommand(
            'batch_tests_file',
            'azure.batch.operations.file_operations#FileOperations.get_from_task',
            operations.file_operations.FileOperations.get_from_task,
            client_factory=get_client)
        self.command_list = _command_type.AzureBatchDataPlaneCommand(
            'batch_tests_list',
            'azure.batch.operations.job_operations#JobOperations.list',
            operations.job_operations.JobOperations.list,
            client_factory=get_client)
        self.command_delete = _command_type.AzureBatchDataPlaneCommand(
            'batch_tests_delete',
            'azure.batch.operations.pool_operations#PoolOperations.delete',
            operations.pool_operations.PoolOperations.delete,
            client_factory=get_client)
        self.command_conflicts = _command_type.AzureBatchDataPlaneCommand(
            'batch_tests_conflicts',
            'azure.batch.operations.job_schedule_operations#JobScheduleOperations.add',
            operations.job_schedule_operations.JobScheduleOperations.add,
            client_factory=get_client,
            flatten=4)
        return super(TestBatchLoader, self).setUp()
Esempio n. 2
0
    def setUp(self):
        def get_client(*args):  # pylint: disable=unused-argument
            creds = SharedKeyCredentials('test1', 'ZmFrZV9hY29jdW50X2tleQ==')
            return BatchServiceClient(creds, 'https://test1.westus.batch.azure.com/')

        self.command_pool = _command_type.AzureBatchDataPlaneCommand(
            'batch_unit_tests',
            'batch_tests_pool',
            'azure.batch.operations.pool_operations#PoolOperations.add',
            get_client, None, 3, None, None, None)
        self.command_job = _command_type.AzureBatchDataPlaneCommand(
            'batch_unit_tests',
            'batch_tests_job',
            'azure.batch.operations.job_operations#JobOperations.add',
            get_client, None, 3,
            ['job.job_manager_task', 'job.job_preparation_task', \
             'job.job_release_task'], None, None)
        self.command_task = _command_type.AzureBatchDataPlaneCommand(
            'batch_unit_tests',
            'batch_tests_task',
            'azure.batch.operations.task_operations#TaskOperations.add',
            get_client, None, 1, None, None, None)
        self.command_file = _command_type.AzureBatchDataPlaneCommand(
            'batch_unit_tests',
            'batch_tests_file',
            'azure.batch.operations.file_operations#FileOperations.get_from_task',
            get_client, None, 3, None, None, None)
        self.command_list = _command_type.AzureBatchDataPlaneCommand(
            'batch_unit_tests',
            'batch_tests_list',
            'azure.batch.operations.job_operations#JobOperations.list',
            get_client, None, 3, None, None, None)
        self.command_delete = _command_type.AzureBatchDataPlaneCommand(
            'batch_unit_tests',
            'batch_tests_delete',
            'azure.batch.operations.pool_operations#PoolOperations.delete',
            get_client, None, 3, None, None, None)
        self.command_conflicts = _command_type.AzureBatchDataPlaneCommand(
            'batch_unit_tests',
            'batch_tests_conflicts',
            'azure.batch.operations.job_schedule_operations#JobScheduleOperations.add',
            get_client, None, 4, None, None, None)
        return super(TestBatchLoader, self).setUp()