This repository has been archived by the owner on Jan 14, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Additional Event parsing tests (#148)
- Loading branch information
1 parent
d2b9fbe
commit 4de9a94
Showing
8 changed files
with
381 additions
and
13 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
mod application; | ||
mod attachment; | ||
pub(super) mod attachment; | ||
mod card; | ||
mod poll; | ||
|
||
|
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
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
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
use super::*; | ||
use std::fs; | ||
use std::path; | ||
|
||
#[test] | ||
fn parse_redis_subscribe() -> Result<(), RedisParseErr> { | ||
|
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 |
---|---|---|
@@ -0,0 +1,99 @@ | ||
Event::TypeSafe( | ||
Update { | ||
payload: Status { | ||
id: Id( | ||
104072557586605107, | ||
), | ||
uri: "https://botsin.space/users/it_was_inevitable/statuses/104072557374505694".to_string(), | ||
created_at: "2020-04-27T21:00:00.000Z".to_string(), | ||
account: Account { | ||
id: Id( | ||
2160, | ||
), | ||
username: "it_was_inevitable".to_string(), | ||
acct: "it_was_inevitable@botsin.space".to_string(), | ||
url: "https://botsin.space/@it_was_inevitable".to_string(), | ||
display_name: "Sentient Dwarf Fortress".to_string(), | ||
note: "<p>It was inevitable.</p><p>Real quotes from Dwarf Fortress dwarves every 5 minutes.</p><p>Too fast? Try <span class=\"h-card\"><a href=\"https://botsin.space/@it_was_inevitable_slow\" class=\"u-url mention\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">@<span>it_was_inevitable_slow</span></a></span>.</p><p><a href=\"https://botsin.space/tags/dwarffortress\" class=\"mention hashtag\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">#<span>dwarffortress</span></a></p>".to_string(), | ||
avatar: "https://instance.codesections.com/system/accounts/avatars/000/002/160/original/9d4fb963ee23aaef.gif?1585017843".to_string(), | ||
avatar_static: "https://instance.codesections.com/system/accounts/avatars/000/002/160/static/9d4fb963ee23aaef.png?1585017843".to_string(), | ||
header: "https://instance.codesections.com/system/accounts/headers/000/002/160/original/d52a62c64b18cac0.png?1585017845".to_string(), | ||
header_static: "https://instance.codesections.com/system/accounts/headers/000/002/160/original/d52a62c64b18cac0.png?1585017845".to_string(), | ||
locked: false, | ||
emojis: [].to_vec(), | ||
discoverable: Some( | ||
true, | ||
), | ||
created_at: "2020-03-24T02:44:05.588Z".to_string(), | ||
statuses_count: 171387, | ||
followers_count: 384, | ||
following_count: 4, | ||
moved: None, | ||
fields: Some( | ||
[ | ||
Field { | ||
name: "Overseer".to_string(), | ||
value: "<span class=\"h-card\"><a href=\"https://mastodon.lubar.me/@ben\" class=\"u-url mention\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">@<span>ben</span></a></span>".to_string(), | ||
verified_at: None, | ||
}, | ||
Field { | ||
name: "Game".to_string(), | ||
value: "<a href=\"http://bay12games.com/dwarves/\" rel=\"nofollow noopener noreferrer\" target=\"_blank\"><span class=\"invisible\">http://</span><span class=\"\">bay12games.com/dwarves/</span><span class=\"invisible\"></span></a>".to_string(), | ||
verified_at: None, | ||
}, | ||
Field { | ||
name: "DFHack".to_string(), | ||
value: "<a href=\"https://dfhack.org/bay12\" rel=\"nofollow noopener noreferrer\" target=\"_blank\"><span class=\"invisible\">https://</span><span class=\"\">dfhack.org/bay12</span><span class=\"invisible\"></span></a>".to_string(), | ||
verified_at: None, | ||
}, | ||
Field { | ||
name: "Code".to_string(), | ||
value: "<a href=\"https://git.io/fNjyH\" rel=\"nofollow noopener noreferrer\" target=\"_blank\"><span class=\"invisible\">https://</span><span class=\"\">git.io/fNjyH</span><span class=\"invisible\"></span></a>".to_string(), | ||
verified_at: None, | ||
}, | ||
].to_vec(), | ||
), | ||
bot: Some( | ||
true, | ||
), | ||
source: None, | ||
group: Some( | ||
false, | ||
), | ||
last_status_at: Some( | ||
"2020-04-27".to_string(), | ||
), | ||
}, | ||
content: "<p>I just wish to help somebody. I\'m uneasy.</p><p>— Mörul Zedotmedtob, Cook</p>".to_string(), | ||
visibility: Public, | ||
sensitive: false, | ||
spoiler_text: "".to_string(), | ||
media_attachments: [].to_vec(), | ||
application: None, | ||
mentions: [].to_vec(), | ||
tags: [].to_vec(), | ||
emojis: [].to_vec(), | ||
reblogs_count: 0, | ||
favourites_count: 0, | ||
replies_count: 0, | ||
url: Some( | ||
"https://botsin.space/@it_was_inevitable/104072557374505694".to_string(), | ||
), | ||
in_reply_to_id: None, | ||
in_reply_to_account_id: None, | ||
reblog: None, | ||
poll: None, | ||
card: None, | ||
language: Some( | ||
"en".to_string(), | ||
), | ||
text: None, | ||
favourited: None, | ||
reblogged: None, | ||
muted: None, | ||
bookmarked: None, | ||
pinned: None, | ||
}, | ||
queued_at: None, | ||
}, | ||
) |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Event::TypeSafe( | ||
Delete { | ||
payload: "104061222412800865".to_string(), | ||
}, | ||
) |
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 |
---|---|---|
@@ -0,0 +1,143 @@ | ||
Event::TypeSafe( | ||
Update { | ||
payload: Status { | ||
id: Id( | ||
104072561966487967, | ||
), | ||
uri: "https://newsbots.eu/users/telesur_es/statuses/104072561638766292".to_string(), | ||
created_at: "2020-04-27T21:01:05.000Z".to_string(), | ||
account: Account { | ||
id: Id( | ||
720, | ||
), | ||
username: "telesur_es".to_string(), | ||
acct: "telesur_es@newsbots.eu".to_string(), | ||
url: "https://newsbots.eu/@telesur_es".to_string(), | ||
display_name: "teleSUR TV (Extraoficial)".to_string(), | ||
note: "<p>Con más 40 corresponsales en el mundo, alzamos nuestra voz donde otros medios callan. teleSUR es la señal informativa de América Latina</p>".to_string(), | ||
avatar: "https://instance.codesections.com/system/accounts/avatars/000/000/720/original/57b77baa5d424d0c.jpeg?1584097695".to_string(), | ||
avatar_static: "https://instance.codesections.com/system/accounts/avatars/000/000/720/original/57b77baa5d424d0c.jpeg?1584097695".to_string(), | ||
header: "https://instance.codesections.com/headers/original/missing.png".to_string(), | ||
header_static: "https://instance.codesections.com/headers/original/missing.png".to_string(), | ||
locked: false, | ||
emojis: [].to_vec(), | ||
discoverable: Some( | ||
false, | ||
), | ||
created_at: "2020-03-13T11:08:17.249Z".to_string(), | ||
statuses_count: 40648, | ||
followers_count: 898, | ||
following_count: 0, | ||
moved: None, | ||
fields: Some( | ||
[ | ||
Field { | ||
name: "Fuente".to_string(), | ||
value: "<a href=\"https://twitter.com/telesurtv\" rel=\"nofollow noopener noreferrer\" target=\"_blank\"><span class=\"invisible\">https://</span><span class=\"\">twitter.com/telesurtv</span><span class=\"invisible\"></span></a>".to_string(), | ||
verified_at: None, | ||
}, | ||
Field { | ||
name: "En inglés".to_string(), | ||
value: "<span class=\"h-card\"><a href=\"https://newsbots.eu/@telesur_en\" class=\"u-url mention\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">@<span>telesur_en</span></a></span>".to_string(), | ||
verified_at: None, | ||
}, | ||
Field { | ||
name: "Operador".to_string(), | ||
value: "<span class=\"h-card\"><a href=\"https://radical.town/@felix\" class=\"u-url mention\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">@<span>felix</span></a></span>".to_string(), | ||
verified_at: None, | ||
}, | ||
Field { | ||
name: "Codigo".to_string(), | ||
value: "<a href=\"https://yerbamate.dev/nutomic/tootbot\" rel=\"nofollow noopener noreferrer\" target=\"_blank\"><span class=\"invisible\">https://</span><span class=\"\">yerbamate.dev/nutomic/tootbot</span><span class=\"invisible\"></span></a>".to_string(), | ||
verified_at: None, | ||
}, | ||
].to_vec(), | ||
), | ||
bot: Some( | ||
true, | ||
), | ||
source: None, | ||
group: Some( | ||
false, | ||
), | ||
last_status_at: Some( | ||
"2020-04-27".to_string(), | ||
), | ||
}, | ||
content: "<p>Autoridades internacionales de la <a href=\"https://newsbots.eu/tags/F%C3%B3rmulaUno\" class=\"mention hashtag\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">#<span>FórmulaUno</span></a> decidieron suspender el Gran Premio de <a href=\"https://newsbots.eu/tags/Francia\" class=\"mention hashtag\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">#<span>Francia</span></a>, que se celebraría el próximo 28 de junio</p><p>Ante esta decisión, la primera parada del Campeonato del Mundo será el Gran Premio de Austria <a href=\"https://www.telesurtv.net/news/suspendido-gran-premio-francia-formula-uno-covid-20200427-0011.html\" rel=\"nofollow noopener noreferrer\" target=\"_blank\"><span class=\"invisible\">https://www.</span><span class=\"ellipsis\">telesurtv.net/news/suspendido-</span><span class=\"invisible\">gran-premio-francia-formula-uno-covid-20200427-0011.html</span></a> </p>".to_string(), | ||
visibility: Public, | ||
sensitive: true, | ||
spoiler_text: "".to_string(), | ||
media_attachments: [ | ||
Attachment { | ||
id: "13283".to_string(), | ||
r#type: Image, | ||
url: "https://instance.codesections.com/system/media_attachments/files/000/013/283/original/0d148b189319d632.jpeg?1588021269".to_string(), | ||
preview_url: "https://instance.codesections.com/system/media_attachments/files/000/013/283/small/0d148b189319d632.jpeg?1588021269".to_string(), | ||
remote_url: Some( | ||
"https://newsbots.eu/system/media_attachments/files/000/199/561/original/8f1042130e797306.jpeg".to_string(), | ||
), | ||
text_url: None, | ||
meta: Some( | ||
json!( | ||
{ | ||
"original": { | ||
"aspect": 1.7751479289940828, | ||
"height": 338, | ||
"size": "600x338", | ||
"width": 600, | ||
}, | ||
"small": { | ||
"aspect": 1.7766666666666666, | ||
"height": 300, | ||
"size": "533x300", | ||
"width": 533, | ||
}, | ||
} | ||
), | ||
), | ||
description: None, | ||
blurhash: Some( | ||
"U9Dcs{QU4mTGu2VFWAkpDinl%2%LxZ%Lxuxu".to_string(), | ||
), | ||
}, | ||
].to_vec(), | ||
application: None, | ||
mentions: [].to_vec(), | ||
tags: [ | ||
Tag { | ||
name: "FórmulaUno".to_string(), | ||
url: "https://instance.codesections.com/tags/F%C3%B3rmulaUno".to_string(), | ||
history: None, | ||
}, | ||
Tag { | ||
name: "francia".to_string(), | ||
url: "https://instance.codesections.com/tags/francia".to_string(), | ||
history: None, | ||
}, | ||
].to_vec(), | ||
emojis: [].to_vec(), | ||
reblogs_count: 0, | ||
favourites_count: 0, | ||
replies_count: 0, | ||
url: Some( | ||
"https://newsbots.eu/@telesur_es/104072561638766292".to_string(), | ||
), | ||
in_reply_to_id: None, | ||
in_reply_to_account_id: None, | ||
reblog: None, | ||
poll: None, | ||
card: None, | ||
language: Some( | ||
"es".to_string(), | ||
), | ||
text: None, | ||
favourited: None, | ||
reblogged: None, | ||
muted: None, | ||
bookmarked: None, | ||
pinned: None, | ||
}, | ||
queued_at: None, | ||
}, | ||
) |
Oops, something went wrong.