mirror of
https://github.com/NLnetLabs/krill.git
synced 2026-09-28 12:24:52 +02:00
Move test_id_certificate to test and use cfg(test). Without the latter cargo publish won't work since we exclude test resources for space.
This commit is contained in:
@@ -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::*;
|
||||
|
||||
@@ -11,10 +11,3 @@ mod signing;
|
||||
pub use self::signing::*;
|
||||
|
||||
pub type CryptoResult<T> = std::result::Result<T, self::error::Error>;
|
||||
|
||||
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()
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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::*;
|
||||
|
||||
|
||||
@@ -800,8 +800,8 @@ impl From<uri::Error> 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::*;
|
||||
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user