(self)
| 689 | self.assertFalse(result) |
| 690 | |
| 691 | def test_search_all(self): |
| 692 | # true if all payload items match all criteria items |
| 693 | op = operators.get_operator("search") |
| 694 | payload = [ |
| 695 | { |
| 696 | "field_name": "waterLevel", |
| 697 | "to_value": 45, |
| 698 | }, |
| 699 | { |
| 700 | "field_name": "waterLevel", |
| 701 | "to_value": 46, |
| 702 | }, |
| 703 | ] |
| 704 | |
| 705 | criteria_pattern = { |
| 706 | "item.waterLevel#1": { |
| 707 | "type": "greaterthan", |
| 708 | "pattern": 40, |
| 709 | }, |
| 710 | "item.waterLevel#2": { |
| 711 | "type": "lessthan", |
| 712 | "pattern": 50, |
| 713 | }, |
| 714 | } |
| 715 | |
| 716 | result = op(payload, criteria_pattern, "all", self._test_function) |
| 717 | self.assertTrue(result) |
| 718 | |
| 719 | payload[0]["to_value"] = 30 |
| 720 | |
| 721 | result = op(payload, criteria_pattern, "all", self._test_function) |
| 722 | self.assertFalse(result) |
| 723 | |
| 724 | payload[0]["to_value"] = 45 |
| 725 | |
| 726 | criteria_pattern["item.waterLevel#3"] = { |
| 727 | "type": "equals", |
| 728 | "pattern": 46, |
| 729 | } |
| 730 | |
| 731 | result = op(payload, criteria_pattern, "all", self._test_function) |
| 732 | self.assertFalse(result) |
| 733 | |
| 734 | def test_search_payload_dict(self): |
| 735 | op = operators.get_operator("search") |
nothing calls this directly
no outgoing calls
no test coverage detected