1
use rpc::references::{Finding, Report, Subject};
2

            
3
use super::*;
4

            
5
1
fn finding() -> Finding {
6
1
    Finding {
7
1
        user: None,
8
1
        subject: Subject::TriggerHost,
9
1
        reason: "links a registry native".to_string(),
10
1
    }
11
1
}
12

            
13
#[test]
14
1
fn a_clean_report_succeeds() {
15
1
    assert!(conclude(&Report::default()).is_ok());
16
1
}
17

            
18
#[test]
19
1
fn a_finding_fails_the_run() {
20
1
    let report = Report {
21
1
        findings: vec![finding()],
22
1
        ..Report::default()
23
1
    };
24
1
    assert!(matches!(conclude(&report), Err(CommandError::Command(_))));
25
1
}