feat: add generated scene skill platform hardening
This commit is contained in:
@@ -75,8 +75,14 @@ fn export_month_lineloss_produces_valid_xlsx() {
|
||||
let mut xml = String::new();
|
||||
std::io::Read::read_to_string(&mut sheet, &mut xml).unwrap();
|
||||
|
||||
assert!(xml.contains("供电单位"), "header row should contain 供电单位");
|
||||
assert!(xml.contains("累计供电量"), "header row should contain 累计供电量");
|
||||
assert!(
|
||||
xml.contains("供电单位"),
|
||||
"header row should contain 供电单位"
|
||||
);
|
||||
assert!(
|
||||
xml.contains("累计供电量"),
|
||||
"header row should contain 累计供电量"
|
||||
);
|
||||
assert!(xml.contains("城关供电"), "data should contain 城关供电");
|
||||
assert!(xml.contains("12345.67"), "data should contain 12345.67");
|
||||
assert!(xml.contains("七里河供电"), "data should contain second row");
|
||||
@@ -99,7 +105,10 @@ fn export_empty_rows_returns_error() {
|
||||
let result = export_lineloss_xlsx(&request);
|
||||
assert!(result.is_err());
|
||||
assert!(
|
||||
result.unwrap_err().to_string().contains("rows must not be empty"),
|
||||
result
|
||||
.unwrap_err()
|
||||
.to_string()
|
||||
.contains("rows must not be empty"),
|
||||
"should reject empty rows"
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user