Fixed tests for git and acme::store
This commit is contained in:
parent
337f3c9cef
commit
7f8e40c19f
@ -166,7 +166,7 @@ impl Store for FSStore {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::domain::acme;
|
||||
use crate::domain::tls;
|
||||
use tempdir::TempDir;
|
||||
|
||||
#[test]
|
||||
@ -179,7 +179,7 @@ mod tests {
|
||||
Err::<PrivateKey, GetAccountKeyError>(GetAccountKeyError::NotFound)
|
||||
));
|
||||
|
||||
let k = acme::PrivateKey::new();
|
||||
let k = tls::PrivateKey::new();
|
||||
|
||||
store.set_account_key(&k).expect("account private key set");
|
||||
|
||||
|
@ -379,9 +379,15 @@ mod tests {
|
||||
};
|
||||
|
||||
let assert_file_not_empty = |path: &str| {
|
||||
let f = store.get_file(&descr, path).expect("file not retrieved");
|
||||
use bytes::BufMut;
|
||||
|
||||
let mut f = store.get_file(&descr, path).expect("file not retrieved");
|
||||
let mut body = bytes::BytesMut::new();
|
||||
|
||||
async move {
|
||||
let body = f.map(|r| r.unwrap()).concat().await;
|
||||
while let Some(chunk) = f.next().await {
|
||||
body.put(chunk.unwrap())
|
||||
}
|
||||
assert!(body.len() > 0);
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user