def test_call(self, testobj, data): """ Test the __call__ method for each test record and blacklist option. """ filter, blacklist = testobj expect = data if data["accept"] is not blacklist else None assert expect == filter(data) return
def test_call(self, testobj, data): """ Test the __call__ method for each test string and blacklist option. """ filter, blacklist = testobj text = data["text"] expect = text if data["accept"] is not blacklist else None assert expect == filter(text) return
def test_call_missing(self, testobj, data): """ Test the __call__ method for each test record and blacklist option. """ filter, blacklist = testobj data = data.copy() # record is NOT test-independent del data["value"] expect = data if blacklist else None assert expect == filter(data) return
def test_call_limits(self, data, start, stop): """ Test the __call__() method with default limits. """ filter = RangeFilter("value", start, stop) if start is None: expect = data if data["value"] < stop else None elif stop is None: expect = data if start <= data["value"] else None else: assert False # shouldn't get here assert expect == filter(data) return