diff --git a/post-deployment/features/tango_tools.feature b/post-deployment/features/tango_tools.feature index cac0436e3c0197c8fae2672d6b2c3acf2989bb9d..74ea34228bc313ee027f43d097560d92bca54402 100644 --- a/post-deployment/features/tango_tools.feature +++ b/post-deployment/features/tango_tools.feature @@ -14,4 +14,6 @@ Scenario: Test starting itango session Scenario: Test REST interface Given the TANGO_HOST is defined in the environment When I make a request with user tango-cs:tango to http://tango-base-tango-rest:8080/tango/rest/rc4/hosts/TANGO_HOST/10000/devices/sys/tg_test/1/attributes/boolean_scalar/value - Then the return code is 200 \ No newline at end of file + Then the return code is 200 + And the result quality is ATTR_VALID + And the result name is boolean_scalar \ No newline at end of file diff --git a/post-deployment/tests/test_tango_tools.py b/post-deployment/tests/test_tango_tools.py index 8591669dfad87ee0b06482e3333adc199f9662d3..d042dd6d0f072811dd79686e4cb0e1457aca24a4 100644 --- a/post-deployment/tests/test_tango_tools.py +++ b/post-deployment/tests/test_tango_tools.py @@ -41,6 +41,7 @@ def curl_rest(run_context, basic_auth, address): pytest.result = requests.get(url, auth=auth_tuple) logging.info("Result text: {}".format(pytest.result.text)) + logging.info("Result json: {}".format(pytest.result.json())) @then(parsers.parse('the return code is {expected_result}')) @@ -49,8 +50,14 @@ def check_return_code(expected_result): # return_code = call_command.returncode if expected_result == '200': assert pytest.result.status_code == int(expected_result), "Curl returned {}, expected {}".format(pytest.result, expected_result) + assert pytest.result.json()['quality'] == 'ATTR_VALID' else: return_code = pytest.result.returncode assert str(return_code) == str(expected_result), "Function returned {}, expected {}".format(pytest.result, expected_result) +@then(parsers.parse('the result {key} is {value}')) +def check_result(key,value): + """result is as expected""" + assert pytest.result.json()[key] == value + scenarios('../features/tango_tools.feature')