Query 'dryrun' Added to Shipyard Client API for Commit Configdocs

Shipyard API to retrieve validation status of a collection of configdocs

2 of 4 Commits (API, CLI, Documentation are in separate commits)

API Client
-added query param to API Client for commit configdocs in shipyard_api_client.py
-unit tests were updated in test_shipyard_api_client.py

Change-Id: I36779d1f83c1e8b006073befd36c74c2721a6332
This commit is contained in:
One-Fine-Day 2018-01-10 09:49:52 -06:00 committed by vd789v
parent 924fce8a71
commit a0c0dcc4f9
2 changed files with 6 additions and 3 deletions

View File

@ -100,13 +100,14 @@ class ShipyardClient(BaseClient):
)
return self.get_resp(url, query_params)
def commit_configdocs(self, force=False):
def commit_configdocs(self, force=False, dryrun=False):
"""
:param force: boolean, True|False
:param dryrun: boolean, True|False
:returns: dictionary, validations from UCP components
:rtype: Response object
"""
query_params = {"force": force}
query_params = {"force": force, "dryrun": dryrun}
url = ApiPaths.COMMIT_CONFIG.value.format(self.get_endpoint())
return self.post_resp(url, query_params)

View File

@ -117,11 +117,13 @@ def test_rendered_config_docs(*args):
def test_commit_configs(*args):
shipyard_client = get_api_client()
force_mode = True
result = shipyard_client.commit_configdocs(force_mode)
dryrun_mode = True
result = shipyard_client.commit_configdocs(force_mode, dryrun_mode)
params = result['params']
assert result['url'] == '{}/commitconfigdocs'.format(
shipyard_client.get_endpoint())
assert params['force'] == force_mode
assert params['dryrun'] == dryrun_mode
@mock.patch.object(BaseClient, 'post_resp', replace_post_rep)