From d3d2abf0742e8d6c998f6e0bd6eafff43f137e6b Mon Sep 17 00:00:00 2001 From: realaravinth Date: Tue, 12 Apr 2022 17:47:34 +0530 Subject: [PATCH] feat: add tests to check for forge types in DB --- db/db-core/src/tests.rs | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/db/db-core/src/tests.rs b/db/db-core/src/tests.rs index 99195df..caef4d1 100644 --- a/db/db-core/src/tests.rs +++ b/db/db-core/src/tests.rs @@ -19,23 +19,18 @@ use crate::prelude::*; /// adding forge works -pub async fn adding_forge_works( - db: &T, - create_forge_msg: CreateForge<'static> -) { - let _ = db.delete_forge_instance(&create_forge_msg.hostname).await; - db.create_forge_isntance(&create_forge_msg).await.unwrap(); - assert!(db.forge_exists(create_forge_msg.hostname).await.unwrap(), "forge creation failed, forge existance check failure"); +pub async fn adding_forge_works(db: &T, create_forge_msg: CreateForge<'static>) { + let _ = db.delete_forge_instance(&create_forge_msg.hostname).await; + db.create_forge_isntance(&create_forge_msg).await.unwrap(); + assert!( + db.forge_exists(create_forge_msg.hostname).await.unwrap(), + "forge creation failed, forge existance check failure" + ); } - /// test if all forge type implementations are loaded into DB pub async fn forge_type_exists_helper(db: &T) { - for f in [ - ForgeImplementation::Gitea - ] - .iter() - { + for f in [ForgeImplementation::Gitea].iter() { println!("Testing forge implementation exists for: {}", f.to_str()); assert!(db.forge_type_exists(f).await.unwrap()); }