def access_by_name(self): f3 = build('F3', match=[re.compile('^sp', re.I)]) x = FilterList([f3]) assert x['sp'] == f3 assert x['spam'] == f3 assert x['sPaMmEr'] == f3
def conflicts(self): f1 = build('F1', match=['foo', 'bar'], conflicts=['spam']) f4 = build('F4', match=['baz'], conflicts=['foo']) x = FilterList([f1]) assert f1 in x assert f4 in x
def regex_strings(self): f1 = build('F1', match=['foo', 'bar'], conflicts=['spam']) f2 = build('F2', match=[re.compile('^spam$')]) f3 = build('F3', match=['bla']) x = FilterList([f1]) assert f1 in x assert f2 in x assert f3 not in x
def plain_strings(self): f1 = build('F1', match=['foo', 'bar'], conflicts=['spam']) f2 = build('F2', match=['spam']) f3 = build('F3', match=['bla']) x = FilterList([f1]) assert f1 in x assert f2 in x assert f3 not in x