mirror of
https://codeberg.org/icewind/ugc-scaper.git
synced 2026-06-03 10:14:11 +02:00
add match page
This commit is contained in:
parent
caf376ac42
commit
668edc434a
9 changed files with 3614 additions and 7 deletions
3402
tests/data/match_116246.html
Normal file
3402
tests/data/match_116246.html
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1,8 +1,8 @@
|
|||
use insta::assert_json_snapshot;
|
||||
use std::fs::read_to_string;
|
||||
use ugc_scraper::parser::{
|
||||
Parser, PlayerDetailsParser, PlayerParser, SeasonsParser, TeamLookupParser, TeamMatchesParser,
|
||||
TeamParser, TeamRosterHistoryParser,
|
||||
MatchPageParser, Parser, PlayerDetailsParser, PlayerParser, SeasonsParser, TeamLookupParser,
|
||||
TeamMatchesParser, TeamParser, TeamRosterHistoryParser,
|
||||
};
|
||||
|
||||
#[test]
|
||||
|
|
@ -92,3 +92,11 @@ fn test_parse_seasons_2_html() {
|
|||
let parsed = parser.parse(&body).unwrap();
|
||||
assert_json_snapshot!(parsed);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_parse_match_html() {
|
||||
let body = read_to_string("tests/data/match_116246.html").unwrap();
|
||||
let parser = MatchPageParser::new();
|
||||
let parsed = parser.parse(&body).unwrap();
|
||||
assert_json_snapshot!(parsed);
|
||||
}
|
||||
|
|
|
|||
18
tests/snapshots/snapshot__parse_match_html.snap
Normal file
18
tests/snapshots/snapshot__parse_match_html.snap
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
source: tests/snapshot.rs
|
||||
expression: parsed
|
||||
---
|
||||
{
|
||||
"comment": "https://logs.tf/3509421#76561198288857894\r\nhttps://logs.tf/3509435#76561198288857894",
|
||||
"comment_author": "Vkid E-sports:",
|
||||
"team_home": {
|
||||
"name": "Vkid E-Sports",
|
||||
"id": 32033
|
||||
},
|
||||
"team_away": {
|
||||
"name": "Xenon",
|
||||
"id": 7861
|
||||
},
|
||||
"score_home": 4,
|
||||
"score_away": 0
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue