def test_leading_wildcards_drops_existing_wildcards(self): terms = '*foo bar* qu*x' result = leading_wildcards(terms) self.assertEquals('(*foo *bar *qux)', result)
def test_leading_wildcards_adds_parentheses(self): terms = 'foo bar' result = leading_wildcards(terms) self.assertTrue(result.startswith('(')) self.assertTrue(result.endswith(')'))
def test_leading_wildcards_prepends_wildcards_to_all_terms(self): terms = 'foo bar qux' result = leading_wildcards(terms) self.assertEquals('(*foo *bar *qux)', result)