feat: define latest_tar on federate trait

This commit is contained in:
Aravinth Manivannan 2023-01-08 00:31:58 +05:30
parent d8126a9268
commit 202600696a
Signed by: realaravinth
GPG key ID: AD9F0F08E855ED88
2 changed files with 6 additions and 1 deletions

View file

@ -76,6 +76,9 @@ pub trait Federate: Sync + Send {
/// publish results in tar ball /// publish results in tar ball
async fn tar(&self) -> Result<PathBuf, Self::Error>; async fn tar(&self) -> Result<PathBuf, Self::Error>;
/// get latest tar ball
async fn latest_tar(&self) -> Result<PathBuf, Self::Error>;
} }
pub fn get_hostname(url: &Url) -> &str { pub fn get_hostname(url: &Url) -> &str {

View file

@ -53,7 +53,9 @@ pub async fn adding_forge_works<'a, T: Federate>(
.unwrap()); .unwrap());
// tar() // tar()
ff.tar().await.unwrap(); let tar = ff.tar().await.unwrap();
let latest = ff.latest_tar().await.unwrap();
assert_eq!(tar, latest);
// delete repository // delete repository
ff.delete_repository(add_repo_msg.owner, add_repo_msg.name, &add_repo_msg.url) ff.delete_repository(add_repo_msg.owner, add_repo_msg.name, &add_repo_msg.url)