Open SatheeshJM opened 5 years ago
Say I have a list
[{"foo" : "bar"}, {"foo: "bar2"}, {"foo" : "bar"},{"random":"1"}]
Is there a way of asserting that the list contains exactly 2 occurrences of {"foo":"bar"}
Can't seem to find anything in the docs.
I would do this
items = [{"foo" : "bar"}, {"foo": "bar2"}, {"foo" : "bar"},{"random":"1"}] search = {"foo" : "bar"} matches = [x for x in items if x == search] matches | should.have.length(2)
Say I have a list
Is there a way of asserting that the list contains exactly 2 occurrences of {"foo":"bar"}
Can't seem to find anything in the docs.