Skip to main content

openapi_lib_generator/
testing.rs

1//! Testing specifications
2//!
3//! These tests fall beyond the scope of cargo test because they are invoked from the CLI
4use crate::generate::utils::ProcessError;
5use std::io::Error as IOError;
6use thiserror::Error;
7
8/// A fake OpenAPI specification
9pub static PETSTORE_YAML: &'static str = include_str!("testing/petstore.yaml");
10/// A name for a testing OpenAPI yaml spec file
11pub static TESTING_SPEC_FILE_NAME: &'static str = "petshoppe_test_spec.yaml";
12/// A testing folder name
13pub static TEST_SUBDIR_NAME: &'static str = "testing";
14/// A testing api url
15pub static TEST_API_URL: &'static str = "https://www.petshoppe.example";
16/// A testing api name
17pub static TEST_API_NAME: &'static str = "PetShoppe";
18/// Testing errors
19#[derive(Debug, Error)]
20pub enum TestingError {
21  #[error(transparent)]
22  IOError(#[from] IOError),
23  #[error(transparent)]
24  ProcessError(#[from] ProcessError),
25}