Created
September 22, 2020 10:47
-
-
Save cuongld2/0674da6c9a81163a080071bf0966dc01 to your computer and use it in GitHub Desktop.
Calling public struct
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use search::SearchElement; | |
#[path="../src/models/search.rs"] | |
pub mod search; | |
use std; | |
#[tokio::test] | |
async fn call_api() -> Result<(), Box<dyn std::error::Error>> { | |
let res = reqwest::Client::builder() | |
.danger_accept_invalid_certs(true) | |
.build() | |
.unwrap() | |
.get("ssl_uncertificate") | |
.send().await?; | |
let json_value: Vec<SearchElement> = res.json().await?; | |
println!("{:?}",json_value); | |
for i in &json_value{ | |
assert_eq!(i.auth_resource_path.is_empty(), false); | |
assert_eq!(i.field.is_empty(), false); | |
assert_eq!(i.id.is_empty(), false); | |
assert_eq!(i.project_id.is_empty(), false); | |
assert_eq!(i.typepp.is_empty(), false); | |
assert_eq!(i.value.is_empty(), false) | |
} | |
Ok(()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment