diff --git a/src/commons/crypto/cert.rs b/src/commons/crypto/cert.rs index 606e8c6e..7d16af88 100644 --- a/src/commons/crypto/cert.rs +++ b/src/commons/crypto/cert.rs @@ -732,7 +732,6 @@ impl From<&PublicKey> for IdExtensions { #[cfg(test)] pub mod tests { - use crate::commons::crypto::test_id_certificate; use crate::test::*; use super::*; diff --git a/src/commons/crypto/mod.rs b/src/commons/crypto/mod.rs index 310676b4..53d41d61 100644 --- a/src/commons/crypto/mod.rs +++ b/src/commons/crypto/mod.rs @@ -11,10 +11,3 @@ mod signing; pub use self::signing::*; pub type CryptoResult = std::result::Result; - -pub fn test_id_certificate() -> IdCert { - use bytes::Bytes; - - let data = include_bytes!("../../../test-resources/oob/id_publisher_ta.cer"); - IdCert::decode(Bytes::from_static(data)).unwrap() -} diff --git a/src/commons/error.rs b/src/commons/error.rs index afa70de9..a0dfd41d 100644 --- a/src/commons/error.rs +++ b/src/commons/error.rs @@ -767,10 +767,10 @@ mod tests { use std::str::FromStr; use crate::commons::api::RoaDefinition; - use crate::commons::crypto::test_id_certificate; use super::*; use crate::test::definition; + use crate::test::test_id_certificate; fn verify(expected_json: &str, e: Error) { let actual = e.to_error_response(); diff --git a/src/commons/remote/rfc6492.rs b/src/commons/remote/rfc6492.rs index f883f187..7caa2612 100644 --- a/src/commons/remote/rfc6492.rs +++ b/src/commons/remote/rfc6492.rs @@ -901,9 +901,9 @@ mod tests { use std::str; use std::str::from_utf8_unchecked; - use crate::commons::crypto::test_id_certificate; use crate::commons::crypto::IdCert; use crate::commons::crypto::ProtocolCms; + use crate::test::test_id_certificate; use super::*; diff --git a/src/commons/remote/rfc8183.rs b/src/commons/remote/rfc8183.rs index 9a1a792b..28aaf259 100644 --- a/src/commons/remote/rfc8183.rs +++ b/src/commons/remote/rfc8183.rs @@ -800,8 +800,8 @@ impl From for Error { mod tests { use rpki::x509::Time; - use crate::commons::crypto::test_id_certificate; use crate::test; + use crate::test::test_id_certificate; use super::*; diff --git a/src/test.rs b/src/test.rs index 226ea116..22ff72b4 100644 --- a/src/test.rs +++ b/src/test.rs @@ -539,3 +539,12 @@ pub fn definition(s: &str) -> RoaDefinition { pub fn typed_prefix(s: &str) -> TypedPrefix { TypedPrefix::from_str(s).unwrap() } + +#[cfg(test)] +use crate::commons::crypto::IdCert; + +#[cfg(test)] +pub fn test_id_certificate() -> IdCert { + let data = include_bytes!("../test-resources/oob/id_publisher_ta.cer"); + IdCert::decode(Bytes::from_static(data)).unwrap() +}