def test_remove_handle(self):
    '\n        Test remove_handle() from casual.py with specially crafted edge cases\n        '
    tokenizer = TweetTokenizer(strip_handles=True)
    test1 = '@twitter hello @twi_tter_. hi @12345 @123news'
    expected = ['hello', '.', 'hi']
    result = tokenizer.tokenize(test1)
    assert (result == expected)
    test2 = '@n`@n~@n(@n)@n-@n=@n+@n\\@n|@n[@n]@n{@n}@n;@n:@n\'@n"@n/@n?@n.@n,@n<@n>@n @n\n@n ñ@n.ü@n.ç@n.'
    expected = ['`', '~', '(', ')', '-', '=', '+', '\\', '|', '[', ']', '{', '}', ';', ':', "'", '"', '/', '?', '.', ',', '<', '>', 'ñ', '.', 'ü', '.', 'ç', '.']
    result = tokenizer.tokenize(test2)
    assert (result == expected)
    test3 = 'a@n j@n z@n A@n L@n Z@n 1@n 4@n 7@n 9@n 0@n _@n !@n @@n #@n $@n %@n &@n *@n'
    expected = ['a', '@n', 'j', '@n', 'z', '@n', 'A', '@n', 'L', '@n', 'Z', '@n', '1', '@n', '4', '@n', '7', '@n', '9', '@n', '0', '@n', '_', '@n', '!', '@n', '@', '@n', '#', '@n', '$', '@n', '%', '@n', '&', '@n', '*', '@n']
    result = tokenizer.tokenize(test3)
    assert (result == expected)
    test4 = '@n!a @n#a @n$a @n%a @n&a @n*a'
    expected = ['!', 'a', '#', 'a', '$', 'a', '%', 'a', '&', 'a', '*', 'a']
    result = tokenizer.tokenize(test4)
    assert (result == expected)
    test5 = '@n!@n @n#@n @n$@n @n%@n @n&@n @n*@n @n@n @@n @n@@n @n_@n @n7@n @nj@n'
    expected = ['!', '@n', '#', '@n', '$', '@n', '%', '@n', '&', '@n', '*', '@n', '@n', '@n', '@', '@n', '@n', '@', '@n', '@n_', '@n', '@n7', '@n', '@nj', '@n']
    result = tokenizer.tokenize(test5)
    assert (result == expected)
    test6 = '@abcdefghijklmnopqrstuvwxyz @abcdefghijklmnopqrst1234 @abcdefghijklmnopqrst_ @abcdefghijklmnopqrstendofhandle'
    expected = ['uvwxyz', '1234', '_', 'endofhandle']
    result = tokenizer.tokenize(test6)
    assert (result == expected)
    test7 = '@abcdefghijklmnopqrstu@abcde @abcdefghijklmnopqrst@abcde @abcdefghijklmnopqrst_@abcde @abcdefghijklmnopqrst5@abcde'
    expected = ['u', '@abcde', '@abcdefghijklmnopqrst', '@abcde', '_', '@abcde', '5', '@abcde']
    result = tokenizer.tokenize(test7)
    assert (result == expected)
Test remove_handle() from casual.py with specially crafted edge cases
def test_remove_handle(self):
    '\n        \n        '
    tokenizer = TweetTokenizer(strip_handles=True)
    test1 = '@twitter hello @twi_tter_. hi @12345 @123news'
    expected = ['hello', '.', 'hi']
    result = tokenizer.tokenize(test1)
    assert (result == expected)
    test2 = '@n`@n~@n(@n)@n-@n=@n+@n\\@n|@n[@n]@n{@n}@n;@n:@n\'@n"@n/@n?@n.@n,@n<@n>@n @n\n@n ñ@n.ü@n.ç@n.'
    expected = ['`', '~', '(', ')', '-', '=', '+', '\\', '|', '[', ']', '{', '}', ';', ':', "'", '"', '/', '?', '.', ',', '<', '>', 'ñ', '.', 'ü', '.', 'ç', '.']
    result = tokenizer.tokenize(test2)
    assert (result == expected)
    test3 = 'a@n j@n z@n A@n L@n Z@n 1@n 4@n 7@n 9@n 0@n _@n !@n @@n #@n $@n %@n &@n *@n'
    expected = ['a', '@n', 'j', '@n', 'z', '@n', 'A', '@n', 'L', '@n', 'Z', '@n', '1', '@n', '4', '@n', '7', '@n', '9', '@n', '0', '@n', '_', '@n', '!', '@n', '@', '@n', '#', '@n', '$', '@n', '%', '@n', '&', '@n', '*', '@n']
    result = tokenizer.tokenize(test3)
    assert (result == expected)
    test4 = '@n!a @n#a @n$a @n%a @n&a @n*a'
    expected = ['!', 'a', '#', 'a', '$', 'a', '%', 'a', '&', 'a', '*', 'a']
    result = tokenizer.tokenize(test4)
    assert (result == expected)
    test5 = '@n!@n @n#@n @n$@n @n%@n @n&@n @n*@n @n@n @@n @n@@n @n_@n @n7@n @nj@n'
    expected = ['!', '@n', '#', '@n', '$', '@n', '%', '@n', '&', '@n', '*', '@n', '@n', '@n', '@', '@n', '@n', '@', '@n', '@n_', '@n', '@n7', '@n', '@nj', '@n']
    result = tokenizer.tokenize(test5)
    assert (result == expected)
    test6 = '@abcdefghijklmnopqrstuvwxyz @abcdefghijklmnopqrst1234 @abcdefghijklmnopqrst_ @abcdefghijklmnopqrstendofhandle'
    expected = ['uvwxyz', '1234', '_', 'endofhandle']
    result = tokenizer.tokenize(test6)
    assert (result == expected)
    test7 = '@abcdefghijklmnopqrstu@abcde @abcdefghijklmnopqrst@abcde @abcdefghijklmnopqrst_@abcde @abcdefghijklmnopqrst5@abcde'
    expected = ['u', '@abcde', '@abcdefghijklmnopqrst', '@abcde', '_', '@abcde', '5', '@abcde']
    result = tokenizer.tokenize(test7)
    assert (result == expected)