feat: def interface to check if repository exists
This commit is contained in:
parent
5e8c3a10cf
commit
76cd9a0fd6
2 changed files with 16 additions and 0 deletions
|
@ -54,6 +54,14 @@ pub trait Federate: Sync + Send {
|
||||||
/// add repository isntance
|
/// add repository isntance
|
||||||
async fn create_repository(&self, f: &AddRepository<'_>) -> Result<(), Self::Error>;
|
async fn create_repository(&self, f: &AddRepository<'_>) -> Result<(), Self::Error>;
|
||||||
|
|
||||||
|
/// check if a repository exists.
|
||||||
|
async fn repository_exists(
|
||||||
|
&self,
|
||||||
|
name: &str,
|
||||||
|
owner: &str,
|
||||||
|
hostname: &str,
|
||||||
|
) -> Result<bool, Self::Error>;
|
||||||
|
|
||||||
/// delete user
|
/// delete user
|
||||||
async fn delete_user(&self, username: &str, hostname: &str) -> Result<(), Self::Error>;
|
async fn delete_user(&self, username: &str, hostname: &str) -> Result<(), Self::Error>;
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,15 @@ pub async fn adding_forge_works<'a, T: Federate>(
|
||||||
.unwrap());
|
.unwrap());
|
||||||
|
|
||||||
// add repository
|
// add repository
|
||||||
|
assert!(!ff
|
||||||
|
.repository_exists(add_repo_msg.name, add_repo_msg.owner, add_repo_msg.hostname)
|
||||||
|
.await
|
||||||
|
.unwrap());
|
||||||
ff.create_repository(&add_repo_msg).await.unwrap();
|
ff.create_repository(&add_repo_msg).await.unwrap();
|
||||||
|
assert!(ff
|
||||||
|
.repository_exists(add_repo_msg.name, add_repo_msg.owner, add_repo_msg.hostname)
|
||||||
|
.await
|
||||||
|
.unwrap());
|
||||||
|
|
||||||
// tar()
|
// tar()
|
||||||
ff.tar().await.unwrap();
|
ff.tar().await.unwrap();
|
||||||
|
|
Loading…
Reference in a new issue