def test_update_success(self): self.put_mock.return_value = fakes.FakeResponse() self.installer_client.update(self.scenario_name, self.installer_json) self.put_mock.assert_called_once_with( self.base_url, data=self.installer_string, headers=clientmanager.ClientManager.headers)
def test_get_one(self): self.get_mock.return_value = fakes.FakeResponse( data=self.scenario_json) self.scenario_client.get_one('def') self.get_mock.assert_called_once_with( self.base_url + '/def', headers=clientmanager.ClientManager.headers)
def test_get_one(self): self.get_mock.return_value = fakes.FakeResponse( data=self.testcase_json) self.testcase_client.get_one(self.project_name, 'def') self.get_mock.assert_called_once_with( self.base_url.format(self.project_name) + '/def', headers=clientmanager.ClientManager.headers)
def test_update_success(self): self.put_mock.return_value = fakes.FakeResponse() self.project_client.update('def', self.project_json) self.put_mock.assert_called_once_with( self.base_url + '/def', data=self.project_string, headers=clientmanager.ClientManager.headers)
def test_get_one(self): self.get_mock.return_value = fakes.FakeResponse( data=self.deployresult_json) self.deployresult_client.get_one('2333') self.get_mock.assert_called_once_with( self.base_url + '/2333', headers=clientmanager.ClientManager.headers)
def test_delete_success(self): self.delete_mock.return_value = fakes.FakeResponse() self.version_client.delete(self.scenario_name, self.installer_name, 'def') kall = self.delete_mock.call_args args, kwargs = kall self.assert_url(args[0], self.base_url + '?installer=installer')
def test_delete_success(self): self.delete_mock.return_value = fakes.FakeResponse() self.installer_client.delete(self.scenario_name, 'def') self.delete_mock.assert_called_once_with( self.base_url, data=json.dumps(['def']), headers=clientmanager.ClientManager.headers)
def test_delete_success(self): self.delete_mock.return_value = fakes.FakeResponse() self.testcase_client.delete(self.project_name, 'def') self.delete_mock.assert_called_once_with( self.base_url.format(self.project_name) + '/def', data=None, headers=clientmanager.ClientManager.headers)
def test_delete_success(self): self.delete_mock.return_value = fakes.FakeResponse() self.scenario_client.delete('def') self.delete_mock.assert_called_once_with( self.base_url + '/def', data=None, headers=clientmanager.ClientManager.headers)
def test_get(self): self.get_mock.return_value = fakes.FakeResponse( data=self.scenarios_rsp) self.scenario_client.get() self.get_mock.assert_called_once_with( self.base_url, headers=clientmanager.ClientManager.headers)
def test_get_search(self): self.get_mock.return_value = fakes.FakeResponse( data=self.deployresults_rsp) self.deployresult_client.get(name='deployresult1') self.get_mock.assert_called_once_with( self.base_url + '?name=deployresult1', headers=clientmanager.ClientManager.headers)
def test_auth_success(self): self.post_mock.return_value = fakes.FakeResponse( data={'text': "success"}) self.app.run( ['-u', 'user', '-p', 'pass', 'pod', 'create', '{"name": "asfad"}']) self.post_mock.assert_called_with('http://localhost:8000/api/v1/pods', data='{"name": "asfad"}', headers=self.headers)
def test_update_success(self): self.put_mock.return_value = fakes.FakeResponse() self.project_client.update(self.scenario_name, self.installer_name, self.version_name, self.project_json) kall = self.put_mock.call_args args, kwargs = kall self.assert_url(args[0], self.base_url + '?installer=installer&version=version')
def test_put_success(self): self.put_mock.return_value = fk.FakeResponse(data=self.scenario_json) scenario_put = scenarios.ScenarioPut(self.app, mock.Mock()) args = ['def', self.scenario_string] verifies = [('name', 'def'), ('scenario', self.scenario_json)] parsed_args = self.check_parser(scenario_put, args, verifies) scenario_put.take_action(parsed_args) self.put_mock.assert_called_once()
def test_create_success(self): self.post_mock.return_value = fakes.FakeResponse(data=self.succ_rsp) self.trust_indicator_client.create(self.scenario_name, self.installer_name, self.version_name, self.project_name, self.trust_indicator_json) self.post_mock.assert_called_once()
def test_create_success(self): self.post_mock.return_value = fakes.FakeResponse(data=self.succ_rsp) pod_create = pods.PodCreate(self.app, mock.Mock()) args = [self.pod_string] verifies = [('pod', self.pod_json)] parsed_args = self.check_parser(pod_create, args, verifies) pod_create.take_action(parsed_args) self.post_mock.assert_called_once()
def test_put_success(self): self.put_mock.return_value = fakes.FakeResponse(data=self.project_json) project_put = projects.ProjectPut(self.app, mock.Mock()) args = ['def', self.project_string] verifies = [('name', 'def'), ('project', self.project_json)] parsed_args = self.check_parser(project_put, args, verifies) project_put.take_action(parsed_args) self.put_mock.assert_called_once()
def test_get_all(self): self.get_mock.return_value = fakes.FakeResponse(data=self.projects_rsp) project_get = projects.ProjectGet(self.app, mock.Mock()) args = [] verifies = [] parsed_args = self.check_parser(project_get, args, verifies) project_get.take_action(parsed_args) self.get_mock.assert_called_once_with( self.base_url, headers=clientmanager.ClientManager.headers)
def test_put_success(self): self.put_mock.return_value = fakes.FakeResponse(data=None) installer_put = scenarios.InstallerPut(self.app, mock.Mock()) args = ['--scenario-name', 's1', self.installer_string] verifies = [('scenario_name', 's1'), ('installer', self.installer_json)] parsed_args = self.check_parser(installer_put, args, verifies) installer_put.take_action(parsed_args) self.put_mock.assert_called_once()
def test_get(self): self.get_mock.return_value = fakes.FakeResponse(data=self.pods_rsp) pod_get = pods.PodGet(self.app, mock.Mock()) args = ['-name', 'dfs'] verifies = [('name', 'dfs')] parsed_args = self.check_parser(pod_get, args, verifies) pod_get.take_action(parsed_args) self.get_mock.assert_called_once_with( self.base_url + '?name=dfs', headers=clientmanager.ClientManager.headers)
def test_auth_failure(self): self.post_mock.return_value = fakes.FakeResponse( data={'text': "login"}) self.app.run( ['-u', 'user', '-p', 'pass', 'pod', 'create', '{"name": "asfad"}']) self.post_mock.assert_called_once_with(self.cas_sever, { 'pass': '******', 'name': 'user', 'form_id': 'user_login' })
def test_get(self): self.get_mock.return_value = fakes.FakeResponse(data=self.results_rsp) result_get = results.ResultGet(self.app, mock.Mock()) args = ['-case', 'dfs'] verifies = [('case', 'dfs')] parsed_args = self.check_parser(result_get, args, verifies) result_get.take_action(parsed_args) self.get_mock.assert_called_once_with( self.base_url + '?case=dfs', headers=clientmanager.ClientManager.headers)
def test_delete_success(self): self.delete_mock.return_value = fakes.FakeResponse() self.custom_client.delete(self.scenario_name, self.installer_name, self.version_name, self.project_name, self.custom_raw) kall = self.delete_mock.call_args args, kwargs = kall self.assert_url( args[0], self.base_url + '?installer=installer&version=version&project=project')
def test_put_success(self): self.put_mock.return_value = fakes.FakeResponse( data=self.testcase_json) testcase_put = testcases.TestcasePut(self.app, mock.Mock()) args = ['--project-name', 'functest', 'def', self.testcase_string] verifies = [('project_name', 'functest'), ('name', 'def'), ('testcase', self.testcase_json)] parsed_args = self.check_parser(testcase_put, args, verifies) testcase_put.take_action(parsed_args) self.put_mock.assert_called_once()
def test_get_one(self): self.get_mock.return_value = fakes.FakeResponse(data=self.result_json) result_get_one = results.ResultGetOne(self.app, mock.Mock()) args = ['def'] verifies = [('result_id', 'def')] parsed_args = self.check_parser(result_get_one, args, verifies) result_get_one.take_action(parsed_args) self.get_mock.assert_called_once_with( self.base_url + '/def', headers=clientmanager.ClientManager.headers)
def test_get_one(self): self.get_mock.return_value = fk.FakeResponse(data=self.scenario_json) scenario_get_one = scenarios.ScenarioGetOne(self.app, mock.Mock()) args = ['def'] verifies = [('name', 'def')] parsed_args = self.check_parser(scenario_get_one, args, verifies) scenario_get_one.take_action(parsed_args) self.get_mock.assert_called_once_with( self.base_url + '/def', headers=clientmanager.ClientManager.headers)
def test_get_all(self): self.get_mock.return_value = fk.FakeResponse(data=self.scenarios_rsp) scenario_get = scenarios.ScenarioGet(self.app, mock.Mock()) args = [] verifies = [] parsed_args = self.check_parser(scenario_get, args, verifies) scenario_get.take_action(parsed_args) self.get_mock.assert_called_once_with( self.base_url, headers=clientmanager.ClientManager.headers)
def test_delete_success(self): self.delete_mock.return_value = fk.FakeResponse() scenario_delete = scenarios.ScenarioDelete(self.app, mock.Mock()) args = ['def'] verifies = [('name', 'def')] parsed_args = self.check_parser(scenario_delete, args, verifies) scenario_delete.take_action(parsed_args) self.delete_mock.assert_called_once_with( self.base_url + '/def', data=None, headers=clientmanager.ClientManager.headers)
def test_get_one(self): self.get_mock.return_value = fakes.FakeResponse( data=self.testcase_json) testcase_get_one = testcases.TestcaseGetOne(self.app, mock.Mock()) args = ['--project-name', 'functest', 'def'] verifies = [('project_name', 'functest'), ('name', 'def')] parsed_args = self.check_parser(testcase_get_one, args, verifies) testcase_get_one.take_action(parsed_args) self.get_mock.assert_called_once_with( self.base_url.format(parsed_args.project_name) + '/def', headers=clientmanager.ClientManager.headers)
def test_get(self): self.get_mock.return_value = fakes.FakeResponse( data=self.testcases_rsp) testcase_get = testcases.TestcaseGet(self.app, mock.Mock()) args = ['--project-name', 'dfs'] verifies = [('project_name', 'dfs')] parsed_args = self.check_parser(testcase_get, args, verifies) testcase_get.take_action(parsed_args) self.get_mock.assert_called_once_with( self.base_url.format(parsed_args.project_name), headers=clientmanager.ClientManager.headers)