Beispiel #1
0
 def test_incorrect_value(self, nested_response):
     comparisons = [{
         "jmespath": "a_bool",
         "operator": "eq",
         "expected": False
     }]
     with pytest.raises(exceptions.JMESError):
         validate_content(nested_response, comparisons)
Beispiel #2
0
 def test_correct_jmes_path(self, nested_response):
     comparisons = [
         {'jmespath': "top.Thing", 'operator': "eq", 'expected': "value"},
         {'jmespath': "an_integer", 'operator': "eq", 'expected': 123},
         {'jmespath': "top.nested.doubly.inner_list", 'operator': "type", 'expected': "list"},
     ]
     validate_content(nested_response, comparisons)
     assert True
Beispiel #3
0
 def test_incorrect_jmes_path(self, nested_response):
     comparisions = [{
         'jmespath': "userId",
         'operator': "eq",
         'expected': 1
     }]
     with pytest.raises(exceptions.JMESError):
         validate_content(nested_response, comparisions)
Beispiel #4
0
 def test_incorrect_jmes_path(self, nested_response):
     comparisons = [{"jmespath": "userId", "operator": "eq", "expected": 1}]
     with pytest.raises(exceptions.JMESError):
         validate_content(nested_response, comparisons)