mirror of
https://github.com/NetworkCats/rustyip.git
synced 2026-11-13 16:17:46 +00:00
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:
@@ -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]
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user