예제 #1
0
def test_forget_fact(db):
    facts.forget_fact('foo')
    db.facts.remove.assert_called_with({
        'term': facts.term_regex('foo'),
    })
예제 #2
0
def test_term_regex():
    pat = facts.term_regex('foo')

    assert bool(pat.match('foo'))
    assert not bool(pat.match('will not match foo'))
예제 #3
0
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 :('))