"""Common functions used to test stack analysis API."""


def contains_alternate_node(json_resp):
    """Check for the existence of alternate node in the stack analysis."""
    assert json_resp is not None
    assert 'result' in json_resp
    # read the actual result
    result = json_resp.get('result')
    return bool(result) and isinstance(result, list) \
        and (result[0].get('recommendation', {}) or {}).get('alternate', None) is not None

@@ -59,114 +59,90 @@
 def 
-contains_alternate_node(json_resp):%0A    %22%22%22Check for the existence of alternate
+get_result_from_payload(json_resp):%0A    %22%22%22Try to get result
  node 
-in
+from
  the 
-stack analysis
+payload
 .%22%22%22
@@ -247,37 +247,200 @@
   re
-sult = json_resp.get('
+turn json_resp.get('result')%0A%0A%0Adef contains_alternate_node(json_resp):%0A    %22%22%22Check for the existence of alternate node in the stack analysis.%22%22%22%0A    result = get_
 result
-'
+_from_payload(json_resp
 )%0A  

Fix for the issue #962