def setUp(self): super(HandlerTests, self).setUp() fx0 = checks.Filter({"type": "ObjectFilter", "expression": "x == 0"}) fy0 = checks.Filter({"type": "ObjectFilter", "expression": "y == 0"}) bad = checks.Filter({"type": "ObjectFilter", "expression": "y =="}) self.ok = [fx0, fy0] self.bad = [fx0, fy0, bad] self.all = [Sample(0, 0), Sample(0, 1), Sample(1, 0), Sample(1, 1)]
def testAddFilters(self): base_filt = checks.Filter(type="Filter", expression="do nothing") self.assertIsInstance(base_filt._filter, filters.Filter) obj_filt = checks.Filter(type="ObjectFilter", expression="test is 'ok'") self.assertIsInstance(obj_filt._filter, filters.ObjectFilter) rdf_filt = checks.Filter(type="RDFFilter", expression="AttributedDict,SSHConfig") self.assertIsInstance(rdf_filt._filter, filters.RDFFilter)