Skip to content

Commit

Permalink
refactor: minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
raghav-rama committed Feb 22, 2024
1 parent c018136 commit 3281a5c
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/bin/tests/async_get_request_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,44 +51,38 @@ mod async_get_request_test {
match env_result {
Ok(val) => {
if val == "true" {
return true;
true
} else {
return false;
false
}
}
Err(_) => {
return false;
}
Err(_) => false,
}
}
fn is_production(&self) -> bool {
let env_result = env::var("PRODUCTION");
match env_result {
Ok(val) => {
if val == "true" {
return true;
true
} else {
return false;
false
}
}
Err(_) => {
return false;
}
Err(_) => false,
}
}
fn is_github_action(&self) -> bool {
let env_result = env::var("GITHUB_ACTIONS");
match env_result {
Ok(val) => {
if val == "true" {
return true;
true
} else {
return false;
false
}
}
Err(_) => {
return false;
}
Err(_) => false,
}
}
}
Expand All @@ -107,6 +101,12 @@ mod async_get_request_test {
}
}

#[test]
fn env_type_should_not_be_unknown() {
let env_config = EnvironmentType::new();
assert_ne!(env_config.get_env(), Environment::Unknown);
}

#[tokio::test]
async fn test_async_get_request() -> Result<()> {
let response = reqwest::get("https://httpbin.org/get").await?;
Expand Down

0 comments on commit 3281a5c

Please sign in to comment.