1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#[derive(Debug, Clone, Serialize, Deserialize, Fail, PartialEq, Eq, Hash)]
pub enum PageExpectation {
#[fail(display = "ValidCode: {}.", _0)]
ValidCode(u32),
#[fail(display = "ValidNoContent.")]
ValidNoContent,
#[fail(display = "ValidContent: {}.", _0)]
ValidContent(String),
#[fail(display = "ValidLength: {} bytes.", _0)]
ValidLength(usize),
#[fail(display = "ValidNoLength.")]
ValidNoLength,
#[fail(display = "ValidAddress: {}", _0)]
ValidAddress(String),
#[fail(display = "ValidNoAddress.")]
ValidNoAddress,
}
pub type PageExpectations = Vec<PageExpectation>;
#[derive(Debug, Copy, Clone, Serialize, Deserialize, Fail)]
pub enum DomainExpectation {
#[fail(display = "ValidExpiryPeriod: {} days.", _0)]
ValidExpiryPeriod(i32),
}
pub type DomainExpectations = Vec<DomainExpectation>;
#[derive(Debug, Clone, Serialize, Deserialize, Fail, PartialEq, Eq, Hash)]
pub enum Expected {
#[fail(display = "URL: {} returns expected final-address: \"{}\".", _0, _1)]
Address(String, String),
#[fail(display = "URL: {} returns expected error-code: {}.", _0, _1)]
HttpCode(String, u32),
#[fail(display = "URL: {} contains expected literal: \"{}\".", _0, _1)]
Content(String, String),
#[fail(display = "URL: {} no content-length validation.", _0)]
NoContentLength(String),
#[fail(display = "URL: {} no content validation.", _0)]
EmptyContent(String),
#[fail(
display = "URL: {} has minimum content-length at least: {} bytes long.",
_0, _1
)]
ContentLength(String, usize),
#[fail(
display = "TLS certificate for domain: {}, will be valid for: {} more days. Requested minimum: {} days.",
_0, _1, _2
)]
TLSCertificateFresh(String, i32, i32),
}