Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaspustina committed Mar 11, 2024
1 parent cf6964c commit f9c6447
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/services/whois/mod.rs
Expand Up @@ -479,7 +479,11 @@ mod tests {
#[tokio::test]
async fn test_5x_1_1_1_1() {
crate::utils::tests::logging::init();
let whois = WhoisClient::default();
let opts = WhoisClientOpts {
timeout: Duration::from_secs(10),
..WhoisClientOpts::default()
};
let whois = WhoisClient::new(opts);

let ip_network = IpNetwork::from_str("1.1.1.1").unwrap();
let ip_networks = vec![ip_network, ip_network, ip_network, ip_network, ip_network];
Expand Down
3 changes: 2 additions & 1 deletion src/services/whois/service.rs
Expand Up @@ -455,7 +455,8 @@ mod tests {
#[tokio::test]
async fn whois() {
crate::utils::tests::logging::init();
let client = RipeStatsClient::new(Default::default());
let opts = RipeStatsClientOpts::new(Duration::from_secs(10));
let client = RipeStatsClient::new(opts);
let ip_address = IpAddr::V4(Ipv4Addr::new(89, 0, 248, 55)).to_string();

let response = client.whois(ip_address).await;
Expand Down
2 changes: 1 addition & 1 deletion tests/lit/lookup-8_8_8_8.output
Expand Up @@ -7,5 +7,5 @@ CHECK: * PTR: 8.8.8.8: dns.google.
CHECK-NEXT: > Running WHOIS queries.
CHECK-NEXT: - Sending up to 3 requests for 3 query types of 1 resources.
CHECK-NEXT: - Received 3 responses [GL 1, NI 1, WI 1], 0 Err within [[\d+]] ms of total run time.
CHECK-NEXT: * 8.8.8.8/32 AS 15169, Prefix 8.8.8.0/24, Net name -, Org -, Authority ARIN, Location -, US
CHECK-NEXT: * 8.8.8.8/32 AS 15169, Prefix 8.8.8.0/24, Net name GOGL, Org Google LLC (GOGL), Authority ARIN, Location -, US
+ Finished.
2 changes: 1 addition & 1 deletion tests/lit/lookup-whois-example.com.output
Expand Up @@ -9,7 +9,7 @@ CHECK-NEXT: * A:
CHECK-NEXT: * AAAA:
CHECK-NEXT: > Running WHOIS queries.
CHECK-NEXT: - Sending up to 6 requests for 3 query types of 2 resources.
CHECK-NEXT: - Received 6 responses [GL 2, NI 2, WI 2], 0 Err within [[\d+]] ms of total run time.
CHECK-NEXT: - Received 6 responses [GL 2, NI 2, WI [[\d+]]], [[\d+]] Err within [[\d+]] ms of total run time.
CHECK-NEXT: [[.+]] AS 15133
CHECK-NEXT: [[.+]] AS 15133
CHECK-NEXT: + Finished.

0 comments on commit f9c6447

Please sign in to comment.