style(import-fifa17): rustfmt the club-family classifier and its tests
This commit is contained in:
@@ -1312,15 +1312,16 @@ pub fn emit_content(
|
|||||||
// cannot derive the right kind (it is FIFA17 taxonomy), so hand it the
|
// cannot derive the right kind (it is FIFA17 taxonomy), so hand it the
|
||||||
// mapping. Players are included too: a definition that was mis-set stays
|
// mapping. Players are included too: a definition that was mis-set stays
|
||||||
// correctable, and a rerun changes nothing.
|
// correctable, and a rerun changes nothing.
|
||||||
let assignments: Vec<serde_json::Value> = report
|
let assignments: Vec<serde_json::Value> =
|
||||||
.definitions
|
report
|
||||||
.supported
|
.definitions
|
||||||
.iter()
|
.supported
|
||||||
.map(|d| serde_json::json!({ "card_id": d.card_id, "content_kind": "player" }))
|
.iter()
|
||||||
.chain(report.non_player.supported.iter().map(|d| {
|
.map(|d| serde_json::json!({ "card_id": d.card_id, "content_kind": "player" }))
|
||||||
serde_json::json!({ "card_id": d.card_id, "content_kind": d.kind.as_str() })
|
.chain(report.non_player.supported.iter().map(
|
||||||
}))
|
|d| serde_json::json!({ "card_id": d.card_id, "content_kind": d.kind.as_str() }),
|
||||||
.collect();
|
))
|
||||||
|
.collect();
|
||||||
let reclassify = content_dir.join("fifa17-reclassify.json");
|
let reclassify = content_dir.join("fifa17-reclassify.json");
|
||||||
write_json_pretty(
|
write_json_pretty(
|
||||||
&reclassify,
|
&reclassify,
|
||||||
|
|||||||
@@ -775,10 +775,7 @@ fn club_item_missing_render_metadata_defers() {
|
|||||||
let plan = plan_non_player_definitions(&profile(&[item], "[]", 100000600));
|
let plan = plan_non_player_definitions(&profile(&[item], "[]", 100000600));
|
||||||
assert!(plan.supported.is_empty());
|
assert!(plan.supported.is_empty());
|
||||||
assert_eq!(plan.deferred.len(), 1);
|
assert_eq!(plan.deferred.len(), 1);
|
||||||
assert_eq!(
|
assert_eq!(plan.deferred[0].reason, "missing_club_item_render_metadata");
|
||||||
plan.deferred[0].reason,
|
|
||||||
"missing_club_item_render_metadata"
|
|
||||||
);
|
|
||||||
|
|
||||||
// Correct kit art, but no team: the kit identity resolver keys on teamid.
|
// Correct kit art, but no team: the kit identity resolver keys on teamid.
|
||||||
let item = r#"{"id":100000502,"resourceId":6300007,"assetId":6300007,
|
let item = r#"{"id":100000502,"resourceId":6300007,"assetId":6300007,
|
||||||
@@ -794,10 +791,7 @@ fn club_item_missing_render_metadata_defers() {
|
|||||||
.to_string();
|
.to_string();
|
||||||
let plan = plan_non_player_definitions(&profile(&[item], "[]", 100000600));
|
let plan = plan_non_player_definitions(&profile(&[item], "[]", 100000600));
|
||||||
assert!(plan.supported.is_empty());
|
assert!(plan.supported.is_empty());
|
||||||
assert_eq!(
|
assert_eq!(plan.deferred[0].reason, "missing_club_item_render_metadata");
|
||||||
plan.deferred[0].reason,
|
|
||||||
"missing_club_item_render_metadata"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Club items are settled by `cardsubtypeid`, not by the id range they occupy.
|
/// Club items are settled by `cardsubtypeid`, not by the id range they occupy.
|
||||||
@@ -820,7 +814,10 @@ fn every_club_family_classifies_and_imports() {
|
|||||||
club(100000505, 8_010_001, 31, 40), // league logo
|
club(100000505, 8_010_001, 31, 40), // league logo
|
||||||
];
|
];
|
||||||
let counts = count_items(&profile(&items, "[]", 100000600));
|
let counts = count_items(&profile(&items, "[]", 100000600));
|
||||||
assert_eq!(counts.club_items, 5, "no club family falls through to Other");
|
assert_eq!(
|
||||||
|
counts.club_items, 5,
|
||||||
|
"no club family falls through to Other"
|
||||||
|
);
|
||||||
assert_eq!(counts.other, 0);
|
assert_eq!(counts.other, 0);
|
||||||
|
|
||||||
let plan = plan_non_player_definitions(&profile(&items, "[]", 100000600));
|
let plan = plan_non_player_definitions(&profile(&items, "[]", 100000600));
|
||||||
|
|||||||
Reference in New Issue
Block a user