예제 #1
0
def test_check_input_false():
    """Test that a token we believe to be bad returns False."""
    from trie import Trie
    trie = Trie()
    token = '$computer'
    assert trie._check_token(token) is False
예제 #2
0
def test_check_input_false_many_bad_characters():
    """Test that a token we believe to be bad returns False."""
    from trie import Trie
    trie = Trie()
    token = '$!*&#^|'
    assert trie._check_token(token) is False
예제 #3
0
def test_check_input_true_with_apostrophe():
    """Test that a token with an apostrophe returns True."""
    from trie import Trie
    trie = Trie()
    token = "computer's"
    assert trie._check_token(token)
예제 #4
0
def test_check_input_true():
    """Test that a token we believe to be good returns True."""
    from trie import Trie
    trie = Trie()
    token = 'computer'
    assert trie._check_token(token)