Skip to content

Commit 540b5e6

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/auto-clone-repo
2 parents a70727f + 7c687c8 commit 540b5e6

File tree

5 files changed

+241
-222
lines changed

5 files changed

+241
-222
lines changed

fplus-database/src/lib.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,22 @@ pub async fn get_database_connection() -> Result<DatabaseConnection, DbErr> {
5050
Err(DbErr::Custom("Database connection is not established".into()))
5151
}
5252
}
53+
54+
/**
55+
* Sets up the initial test environment (database connection and env variables)
56+
*/
57+
pub async fn setup_test_environment() {
58+
init();
59+
setup().await.expect("Failed to setup database connection.");
60+
}
61+
5362
#[cfg(test)]
5463
mod tests {
5564

5665
use super::*;
5766
use tokio;
5867
use serial_test::serial;
5968

60-
/**
61-
* Sets up the initial test environment (database connection and env variables)
62-
*/
63-
async fn setup_test_environment() {
64-
init();
65-
setup().await.expect("Failed to setup database connection.");
66-
}
67-
6869
/**
6970
* Test the establish_connection function
7071
*

fplus-lib/src/core/allocator/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
use octocrab::models::repos::ContentItems;
22

33
use crate::config::get_env_var_or_default;
4-
use crate::{base64::decode_allocator_model, error::LDNError, external_services::github::GithubWrapper};
4+
use crate::external_services::github::github_async_new;
5+
use crate::{base64::decode_allocator_model, error::LDNError};
56

67
use self::file::AllocatorModel;
78

@@ -14,7 +15,7 @@ pub async fn process_allocator_file(file_name: &str) -> Result<AllocatorModel, L
1415
let branch = "main";
1516
let path = file_name.to_string();
1617

17-
let gh = GithubWrapper::new(owner.to_string(), repo.to_string());
18+
let gh = github_async_new(owner.to_string(), repo.to_string()).await;
1819
let content_items = gh.get_file(&path, branch).await.map_err(|e| LDNError::Load(e.to_string()))?;
1920
let model = content_items_to_allocator_model(content_items).map_err(|e| LDNError::Load(e.to_string()))?;
2021

0 commit comments

Comments
 (0)