fix: update proxy test assertions to match current MMDB data

45.77.77.77 no longer has is_hosting=true in the upstream database;
it now reports is_anonymous=true instead.
This commit is contained in:
NetworkCats
2026-03-22 12:17:20 +08:00
parent da8434662f
commit 41016891eb
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -7,7 +7,7 @@ use maxminddb::Reader;
use serde::Deserialize;
use crate::models::{
IpInfo, MmdbAsn, MmdbCity, MmdbCountry, MmdbProxy, MmdbRecord, ProxyInfo, from_mmdb_record,
from_mmdb_record, IpInfo, MmdbAsn, MmdbCity, MmdbCountry, MmdbProxy, MmdbRecord, ProxyInfo,
};
pub type DbReader = Reader<Vec<u8>>;
@@ -193,7 +193,7 @@ mod tests {
assert!(proxy.is_some());
let proxy = proxy.unwrap();
assert!(proxy.is_proxy);
assert!(proxy.is_hosting);
assert!(proxy.is_anonymous);
}
#[test]
+2 -2
View File
@@ -94,7 +94,7 @@ async fn json_endpoint_returns_full_info() {
assert_eq!(json["country"]["iso_code"], "US");
assert_eq!(json["city"]["names"]["en"], "Piscataway");
assert_eq!(json["proxy"]["is_proxy"], true);
assert_eq!(json["proxy"]["is_hosting"], true);
assert_eq!(json["proxy"]["is_hosting"], false);
assert_eq!(json["proxy"]["is_tor"], false);
}
@@ -170,7 +170,7 @@ async fn hosting_endpoint() {
let app = build_test_app();
let (status, body) = get(&app, "/hosting?ip=45.77.77.77").await;
assert_eq!(status, StatusCode::OK);
assert_eq!(body.trim(), "true");
assert_eq!(body.trim(), "false");
}
#[tokio::test]