Stuff and things
This commit is contained in:
parent
14a78b4717
commit
7ba3716b98
32 changed files with 1211 additions and 1136 deletions
|
|
@ -2,11 +2,13 @@ from discord_rss_bot.filter.utils import is_word_in_text
|
|||
|
||||
|
||||
def test_is_word_in_text() -> None:
|
||||
assert is_word_in_text("word1,word2", "This is a sample text containing word1 and word2.") is True
|
||||
assert is_word_in_text("word1,word2", "This is a sample text containing word1.") is True
|
||||
assert is_word_in_text("word1,word2", "This is a sample text containing word2.") is True
|
||||
assert is_word_in_text("word1,word2", "This is a sample text containing WORD1 and WORD2.") is True
|
||||
assert is_word_in_text("Alert,Forma", "Outbreak - Mutagen Mass - Rhea (Saturn)") is False
|
||||
msg_true = "Should return True"
|
||||
msg_false = "Should return False"
|
||||
|
||||
assert is_word_in_text("Alert,Forma", "Outbreak - Mutagen Mass - Rhea (Saturn)") is False
|
||||
assert is_word_in_text("word1,word2", "This is a sample text containing none of the words.") is False
|
||||
assert is_word_in_text("word1,word2", "This is a sample text containing word1 and word2.") is True, msg_true
|
||||
assert is_word_in_text("word1,word2", "This is a sample text containing word1.") is True, msg_true
|
||||
assert is_word_in_text("word1,word2", "This is a sample text containing word2.") is True, msg_true
|
||||
assert is_word_in_text("word1,word2", "This is a sample text containing WORD1 and WORD2.") is True, msg_true
|
||||
assert is_word_in_text("Alert,Forma", "Outbreak - Mutagen Mass - Rhea (Saturn)") is False, msg_false
|
||||
assert is_word_in_text("Alert,Forma", "Outbreak - Mutagen Mass - Rhea (Saturn)") is False, msg_false
|
||||
assert is_word_in_text("word1,word2", "This is a sample text containing none of the words.") is False, msg_false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue