feat: def forge_exists interface
This commit is contained in:
parent
6fb71e0641
commit
0d0f5270fd
2 changed files with 5 additions and 0 deletions
|
@ -42,6 +42,9 @@ pub trait Federate: Sync + Send {
|
||||||
/// delete forge isntance
|
/// delete forge isntance
|
||||||
async fn delete_forge_instance(&self, hostname: &str) -> Result<(), Self::Error>;
|
async fn delete_forge_instance(&self, hostname: &str) -> Result<(), Self::Error>;
|
||||||
|
|
||||||
|
/// check if a forge instance exists
|
||||||
|
async fn forge_exists(&self, hostname: &str) -> Result<bool, Self::Error>;
|
||||||
|
|
||||||
/// create user isntance
|
/// create user isntance
|
||||||
async fn create_user(&self, f: &AddUser<'_>) -> Result<(), Self::Error>;
|
async fn create_user(&self, f: &AddUser<'_>) -> Result<(), Self::Error>;
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,9 @@ pub async fn adding_forge_works<'a, T: Federate>(
|
||||||
add_repo_msg: AddRepository<'a>,
|
add_repo_msg: AddRepository<'a>,
|
||||||
) {
|
) {
|
||||||
let _ = ff.delete_forge_instance(create_forge_msg.hostname).await;
|
let _ = ff.delete_forge_instance(create_forge_msg.hostname).await;
|
||||||
|
assert!(!ff.forge_exists(&create_forge_msg.hostname).await.unwrap());
|
||||||
ff.create_forge_isntance(&create_forge_msg).await.unwrap();
|
ff.create_forge_isntance(&create_forge_msg).await.unwrap();
|
||||||
|
assert!(ff.forge_exists(&create_forge_msg.hostname).await.unwrap());
|
||||||
// add user
|
// add user
|
||||||
ff.create_user(&create_user_msg).await.unwrap();
|
ff.create_user(&create_user_msg).await.unwrap();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue