from_lox_credential() now returns a Result

This commit is contained in:
Vecna 2024-03-29 16:18:34 -04:00
parent 2bbc0e8705
commit eb1b4939be
1 changed files with 8 additions and 4 deletions

View File

@ -476,7 +476,8 @@ mod tests {
&cred, &cred,
&th.context.ba.lock().unwrap().lox_pub, &th.context.ba.lock().unwrap().lox_pub,
"ru".to_string(), "ru".to_string(),
); )
.unwrap();
reports.push(report.to_serializable_report()); reports.push(report.to_serializable_report());
} }
assert_eq!(reports.len(), 3); assert_eq!(reports.len(), 3);
@ -490,7 +491,8 @@ mod tests {
&cred, &cred,
&th.context.ba.lock().unwrap().lox_pub, &th.context.ba.lock().unwrap().lox_pub,
"ru".to_string(), "ru".to_string(),
); )
.unwrap();
invalid_report_1.date = invalid_report_1.date + 2; invalid_report_1.date = invalid_report_1.date + 2;
reports.push(invalid_report_1.to_serializable_report()); reports.push(invalid_report_1.to_serializable_report());
@ -501,7 +503,8 @@ mod tests {
&cred, &cred,
&th.context.ba.lock().unwrap().lox_pub, &th.context.ba.lock().unwrap().lox_pub,
"xx".to_string(), "xx".to_string(),
); )
.unwrap();
reports.push(invalid_report_2.to_serializable_report()); reports.push(invalid_report_2.to_serializable_report());
// Check that well-formed reports with incorrect bridge data are not counted // Check that well-formed reports with incorrect bridge data are not counted
@ -517,7 +520,8 @@ mod tests {
&cred, &cred,
&th.context.ba.lock().unwrap().lox_pub, &th.context.ba.lock().unwrap().lox_pub,
"ru".to_string(), "ru".to_string(),
); )
.unwrap();
invalid_report_3.fingerprint = empty_bridgeline_fingerprint; invalid_report_3.fingerprint = empty_bridgeline_fingerprint;
reports.push(invalid_report_3.to_serializable_report()); reports.push(invalid_report_3.to_serializable_report());