add tests for API methods

This commit is contained in:
Dustin J. Mitchell
2020-11-26 17:27:17 -05:00
parent 3fb2327a5b
commit 7472749fee
8 changed files with 299 additions and 14 deletions

View File

@@ -1,8 +1,9 @@
use crate::server::SyncServer;
use actix_web::{web, Scope};
use std::sync::Arc;
pub(crate) mod add_version;
pub(crate) mod get_child_version;
mod add_version;
mod get_child_version;
/// The content-type for history segments (opaque blobs of bytes)
pub(crate) const HISTORY_SEGMENT_CONTENT_TYPE: &str =
@@ -16,3 +17,9 @@ pub(crate) const PARENT_VERSION_ID_HEADER: &str = "X-Parent-Version-Id";
/// The type containing a reference to the SyncServer object in the Actix state.
pub(crate) type ServerState = Arc<Box<dyn SyncServer>>;
pub(crate) fn api_scope() -> Scope {
web::scope("")
.service(get_child_version::service)
.service(add_version::service)
}