updateinfo-xmlparser/src/test.rs
Jia Chao 3588e49e41 更新,测试
Signed-off-by: Jia Chao <jiachao2130@126.com>
2024-08-05 16:27:29 +08:00

27 lines
737 B
Rust

use crate::*;
#[test]
fn it_works() {
let updatexml = "test/updateinfo.xml";
let mut db = UpdateInfoDb::new();
db.load_xml(&updatexml).unwrap();
let id = "openEuler-SA-2022-1587";
let title = "An update for mariadb is now available for openEuler-22.03-LTS";
let severity = cvrf_xmlparser::Severity::High;
let release = "openEuler";
let cves = 10;
let sa = "openEuler-SA-2022-1587";
let updateinfo = &db.db[0];
assert_eq!(updateinfo.id, id);
assert_eq!(updateinfo.title, title);
assert_eq!(updateinfo.severity, severity);
assert_eq!(updateinfo.release, release);
assert_eq!(updateinfo.cves.len(), cves);
assert_eq!(updateinfo.pkglist[0].sa(), sa);
assert!(true);
}