attribute should match for all

This commit is contained in:
abikouo
2021-05-20 12:23:07 +02:00
parent 930c551654
commit 483c91ca22
2 changed files with 19 additions and 1 deletions

View File

@@ -60,6 +60,24 @@ def test_boolean_value():
assert match_json_property(None, data, "containers[*].connected", "TRUE")
assert match_json_property(None, data, "containers[0].poweron", "false")
data = {
"containers": [
{"image": "nginx", "ready": False},
{"image": "python", "ready": False},
{"image": "mongo", "ready": True}
]
}
assert not match_json_property(None, data, "containers[*].ready", "true")
data = {
"containers": [
{"image": "nginx", "ready": True},
{"image": "python", "ready": True},
{"image": "mongo", "ready": True}
]
}
assert match_json_property(None, data, "containers[*].ready", "true")
def test_valid_expression():
data = dict(key="ansible", value="unit-test")