def test_dyanmic_lookup(self): class WithAProperty(object): def __init__(self, value): self.property = value records = [WithAProperty('one'), WithAProperty('two'), WithAProperty('one')] rf = RecordFactory(None, None) rf.records = records filtered = rf.dynamic_record_lookup('property', 'one') self.assertEqual(len(filtered), 2) filtered = rf.dynamic_record_lookup('nothing', 'one') self.assertEqual(len(filtered), 0)
def test_dyanmic_lookup(self): class WithAProperty(object): def __init__(self, value): self.property = value records = [ WithAProperty('one'), WithAProperty('two'), WithAProperty('one') ] rf = RecordFactory(None, None) rf.records = records filtered = rf.dynamic_record_lookup('property', 'one') self.assertEqual(len(filtered), 2) filtered = rf.dynamic_record_lookup('nothing', 'one') self.assertEqual(len(filtered), 0)