tenant deletion/reset
This commit is contained in:
@@ -129,6 +129,25 @@ impl FakeStorage {
|
||||
let guard = self.objects.lock().await;
|
||||
guard.len()
|
||||
}
|
||||
|
||||
pub async fn object_count_with_prefix(&self, prefix: &str) -> usize {
|
||||
let guard = self.objects.lock().await;
|
||||
guard.keys().filter(|key| key.starts_with(prefix)).count()
|
||||
}
|
||||
|
||||
pub async fn contains_key(&self, key: &str) -> bool {
|
||||
let guard = self.objects.lock().await;
|
||||
guard.contains_key(key)
|
||||
}
|
||||
|
||||
pub async fn keys_with_prefix(&self, prefix: &str) -> Vec<String> {
|
||||
let guard = self.objects.lock().await;
|
||||
guard
|
||||
.keys()
|
||||
.filter(|key| key.starts_with(prefix))
|
||||
.cloned()
|
||||
.collect()
|
||||
}
|
||||
}
|
||||
|
||||
pub struct TestApp {
|
||||
|
||||
Reference in New Issue
Block a user