-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Xavi
committed
Mar 11, 2024
1 parent
5be799c
commit 33dd146
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -548,6 +548,67 @@ def test_remove_self_username_from_content(content, expected_position, expected_ | |
[], # No Feeds found | ||
"@[email protected]" # Who is actually mentioning | ||
), | ||
# Action TEST, missing parameters | ||
( | ||
"@feeder test", | ||
MentionAction.TEST, # test | ||
{}, # No complements | ||
MentionParser.ERROR_MISSING_PARAMS, | ||
False, # return for parse() | ||
False, # The site_url is not a valid feed itself | ||
[], # No Feeds found | ||
"@[email protected]" # Who is actually mentioning | ||
), | ||
# Action TEST, the site URL is invalid. The schema is mandatory | ||
( | ||
"@feeder test xavi.com", | ||
MentionAction.TEST, # test | ||
{}, # No complements | ||
MentionParser.ERROR_INVALID_URL, | ||
False, # return for parse() | ||
False, # The site_url is not a valid feed itself | ||
[], # No Feeds found | ||
"@[email protected]" # Who is actually mentioning | ||
), | ||
# Action TEST, the site URL is invalid. Random 1 | ||
( | ||
"@feeder test http://xavi,com", | ||
MentionAction.TEST, # test | ||
{}, # No complements | ||
MentionParser.ERROR_INVALID_URL, | ||
False, # return for parse() | ||
False, # The site_url is not a valid feed itself | ||
[], # No Feeds found | ||
"@[email protected]" # Who is actually mentioning | ||
), | ||
# Action TEST, the site URL is also the feed URL | ||
( | ||
"@feeder test https://xavier.arnaus.net/blog.rss", | ||
MentionAction.TEST, # test | ||
{ | ||
"site_url": "https://xavier.arnaus.net/blog.rss", | ||
"feed_url": "https://xavier.arnaus.net/blog.rss" | ||
}, | ||
None, | ||
True, # return for parse() | ||
True, # The site_url is a valid feed itself | ||
[], # No Feeds found | ||
"@[email protected]" # Who is actually mentioning | ||
), | ||
# Action TEST, the feed URL is discovered, taking the first item | ||
( | ||
"@feeder test https://xavier.arnaus.net/blog", | ||
MentionAction.TEST, # test | ||
{ | ||
"site_url": "https://xavier.arnaus.net/blog", | ||
"feed_url": "https://xavier.arnaus.net/blog.rss" | ||
}, | ||
None, | ||
True, # return for parse() | ||
False, # The site_url is not a valid feed itself | ||
["https://xavier.arnaus.net/blog.rss", "https://xavier.arnaus.net/blog.atom"], | ||
"@[email protected]" # Who is actually mentioning | ||
), | ||
], | ||
) | ||
def test_parse( | ||
|