Skip to content

Instantly share code, notes, and snippets.

@sjmf
Last active October 24, 2015 14:33
Show Gist options
  • Save sjmf/f9abc227c99c8c416ea9 to your computer and use it in GitHub Desktop.
Save sjmf/f9abc227c99c8c416ea9 to your computer and use it in GitHub Desktop.
Testcases for tweet stripping
def test():
assert get_msg("@ol_fridge print this please", "ol_fridge") == "print this please"
assert get_msg(".@ol_fridge print this too", "ol_fridge") == "print this too"
assert get_msg("This should be printed too @ol_fridge", "ol_fridge") == "This should be printed too"
assert get_msg("@ol_fridge @SamMFinnigan this should too", "ol_fridge") == "this should too"
assert get_msg("@SamMFinnigan @ol_fridge this should also", "ol_fridge") == "this should also"
# don't print these
assert get_msg("But @ol_fridge shouldn't", "ol_fridge") == False
assert get_msg("@SamMFinnigan don't print @ol_fridge", "ol_fridge") == False
assert get_msg(".@SamMFinnigan don't print @ol_fridge", "ol_fridge") == False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment