Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/storage/src/storage/bidi_write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@

//! Internal traits and types for Appendable Object Write (Bidi Write).

#![allow(dead_code)]

pub(crate) mod connector;
mod redirect;
mod retry_redirect;
pub(crate) mod stub;
pub(crate) mod transport;
mod worker;

use crate::google::storage::v2::{BidiWriteObjectRequest, BidiWriteObjectResponse};
use crate::request_options::RequestOptions;
Expand All @@ -27,7 +32,6 @@ use tokio::sync::mpsc::Receiver;
/// A trait to mock `Streaming<T>` in the unit tests.
///
/// This is not a public trait, we only need this for our own testing.
#[allow(dead_code)]
pub(crate) trait TonicStreaming: std::fmt::Debug + Send + 'static {
fn next_message(
&mut self,
Expand All @@ -44,7 +48,6 @@ impl TonicStreaming for Streaming<BidiWriteObjectResponse> {
/// A trait to mock `gaxi::grpc::Client` in the unit tests.
///
/// This is not a public trait, we only need this for our own testing.
#[allow(dead_code)]
pub(crate) trait Client: std::fmt::Debug + Send + 'static {
type Stream: Sized;
fn start(
Expand Down Expand Up @@ -82,6 +85,9 @@ impl Client for gaxi::grpc::Client {
}
}

#[cfg(test)]
mod mocks;

#[cfg(test)]
pub(crate) mod tests {
use crate::Error;
Expand Down Expand Up @@ -135,14 +141,12 @@ pub(crate) mod tests {
)
}

#[allow(dead_code)]
pub(crate) fn test_options() -> RequestOptions {
let mut options = RequestOptions::new();
options.backoff_policy = Arc::new(test_backoff());
options
}

#[allow(dead_code)]
fn test_backoff() -> impl google_cloud_gax::backoff_policy::BackoffPolicy {
use std::time::Duration;
google_cloud_gax::exponential_backoff::ExponentialBackoffBuilder::new()
Expand Down
Loading
Loading