def test_forget_fact(db): facts.forget_fact('foo') db.facts.remove.assert_called_with({ 'term': facts.term_regex('foo'), })
def test_term_regex(): pat = facts.term_regex('foo') assert bool(pat.match('foo')) assert not bool(pat.match('will not match foo'))
def test_term_regex_handles_unicode(): snowman = u'☃' pat = facts.term_regex(snowman) assert bool(pat.match(snowman)) assert not bool(pat.match('no snowman for you :('))