mirror of
https://codeberg.org/icewind/ugc-scaper.git
synced 2026-06-03 18:24:10 +02:00
add transactions
This commit is contained in:
parent
0cada6847a
commit
bd2cd8afe6
9 changed files with 2907 additions and 32 deletions
2639
tests/data/transactions_4v4.html
Normal file
2639
tests/data/transactions_4v4.html
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -2,7 +2,7 @@ use insta::assert_json_snapshot;
|
|||
use std::fs::read_to_string;
|
||||
use ugc_scraper::parser::{
|
||||
MatchPageParser, Parser, PlayerDetailsParser, PlayerParser, SeasonsParser, TeamLookupParser,
|
||||
TeamMatchesParser, TeamParser, TeamRosterHistoryParser,
|
||||
TeamMatchesParser, TeamParser, TeamRosterHistoryParser, TransactionParser,
|
||||
};
|
||||
|
||||
#[test]
|
||||
|
|
@ -100,3 +100,11 @@ fn test_parse_match_html() {
|
|||
let parsed = parser.parse(&body).unwrap();
|
||||
assert_json_snapshot!(parsed);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_parse_transaction_html() {
|
||||
let body = read_to_string("tests/data/transactions_4v4.html").unwrap();
|
||||
let parser = TransactionParser::new();
|
||||
let parsed = parser.parse(&body).unwrap();
|
||||
assert_json_snapshot!(parsed);
|
||||
}
|
||||
|
|
|
|||
69
tests/snapshots/snapshot__parse_transaction_html.snap
Normal file
69
tests/snapshots/snapshot__parse_transaction_html.snap
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
---
|
||||
source: tests/snapshot.rs
|
||||
expression: parsed
|
||||
---
|
||||
[
|
||||
{
|
||||
"name": "L9 ivan",
|
||||
"steam_id": 76561199017754044,
|
||||
"action": "Joined",
|
||||
"team": {
|
||||
"name": "1. e4 e5 2. Ke2 Ke7",
|
||||
"id": 33233
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Rhythm",
|
||||
"steam_id": 76561198062801366,
|
||||
"action": "Joined",
|
||||
"team": {
|
||||
"name": "#FreeTheBlackHeavy",
|
||||
"id": 33011
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "G Punish",
|
||||
"steam_id": 76561198207987376,
|
||||
"action": "Left",
|
||||
"team": {
|
||||
"name": "1. e4 e5 2. Ke2 Ke7",
|
||||
"id": 33233
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "hellboy",
|
||||
"steam_id": 76561199089196165,
|
||||
"action": "Joined",
|
||||
"team": {
|
||||
"name": "1. e4 e5 2. Ke2 Ke7",
|
||||
"id": 33233
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "realhedgehog2082",
|
||||
"steam_id": 76561198168931330,
|
||||
"action": "Left",
|
||||
"team": {
|
||||
"name": "1. e4 e5 2. Ke2 Ke7",
|
||||
"id": 33233
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Rhythm",
|
||||
"steam_id": 76561198062801366,
|
||||
"action": "Left",
|
||||
"team": {
|
||||
"name": "el gato",
|
||||
"id": 33014
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Pope Sonder",
|
||||
"steam_id": 76561198214202059,
|
||||
"action": "Left",
|
||||
"team": {
|
||||
"name": "Gaelic Gladiators",
|
||||
"id": 29916
|
||||
}
|
||||
}
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue