@@ -71,6 +71,25 @@ def test_jmspath_return_none(jmspath):
71
71
"" ,
72
72
marks = pytest .mark .xfail (reason = "Jmespath issue - path returns empty list." ),
73
73
),
74
+ ("global.peers.*.is_enabled" , [True , True , False , True ]),
75
+ (
76
+ "global.peers.$*$.is_enabled" ,
77
+ [
78
+ {"10.1.0.0" : {"is_enabled" : True }},
79
+ {"10.2.0.0" : {"is_enabled" : True }},
80
+ {"10.64.207.255" : {"is_enabled" : False }},
81
+ {"7.7.7.7" : {"is_enabled" : True }},
82
+ ],
83
+ ),
84
+ (
85
+ "global.peers.$*$.[is_enabled]" ,
86
+ [
87
+ {"10.1.0.0" : {"is_enabled" : True }},
88
+ {"10.2.0.0" : {"is_enabled" : True }},
89
+ {"10.64.207.255" : {"is_enabled" : False }},
90
+ {"7.7.7.7" : {"is_enabled" : True }},
91
+ ],
92
+ ),
74
93
]
75
94
76
95
@@ -81,5 +100,5 @@ def test_extract_data_from_json(jmspath, expected_value):
81
100
"""Test JMSPath return value."""
82
101
data = load_json_file ("napalm_get_bgp_neighbors" , "multi_vrf.json" )
83
102
value = extract_data_from_json (data = data , path = jmspath )
84
-
103
+ print ( value )
85
104
assert value == expected_value , ASSERT_FAIL_MESSAGE .format (output = value , expected_output = expected_value )
0 commit comments