Skip to content

Commit

Permalink
[Rust-Axum] Update tests to not use templates (#20427)
Browse files Browse the repository at this point in the history
* Update tests to not use templates

* Wrong filename
  • Loading branch information
Victoria-Casasampere-BeeTheData authored Jan 10, 2025
1 parent d30220b commit 29f7c2e
Show file tree
Hide file tree
Showing 37 changed files with 8 additions and 157 deletions.
8 changes: 4 additions & 4 deletions bin/utils/test_file_list.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
- filename: "samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ZebraTest.java"
sha256: 15eeb6d8a9a79d0f1930b861540d9c5780d6c49ea4fdb68269ac3e7ec481e142
# rust axum test files
- filename: "samples/server/petstore/rust-axum/output/rust-axum-oneof/src/tests.rs"
sha256: 3d4198174018cc7fd9d4bcffd950609a5bd306cf03b2fa780516f4e22a566e8c
- filename: "samples/server/petstore/rust-axum/output/openapi-v3/src/tests.rs"
sha256: 356ac684b1fce91b153c63caefc1fe7472ea600ac436a19631e16bc00e986c50
- filename: "samples/server/petstore/rust-axum/output/rust-axum-oneof/tests/oneof_with_discriminator.rs"
sha256: 2d4f5a069fdcb3057bb078d5e75b3de63cd477b97725e457079df24bd2c30600
- filename: "samples/server/petstore/rust-axum/output/openapi-v3/tests/oneof_untagged.rs"
sha256: e72fbf81a9849dc7abb7e2169f2fc355c8b1cf991c0e2ffc083126abd9e966e7
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,6 @@ public RustAxumServerCodegen() {
supportingFiles.add(new SupportingFile("header.mustache", "src", "header.rs"));
supportingFiles.add(new SupportingFile("server-mod.mustache", "src/server", "mod.rs"));
supportingFiles.add(new SupportingFile("apis-mod.mustache", apiPackage().replace('.', File.separatorChar), "mod.rs"));
// The file gets overwritten regardless
supportingFiles.add(new SupportingFile("tests.mustache", "src", "tests.rs").doNotOverwrite());
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md").doNotOverwrite());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,3 @@ pub mod apis;

#[cfg(feature = "server")]
pub(crate) mod header;

#[cfg(test)]
mod tests;

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ src/header.rs
src/lib.rs
src/models.rs
src/server/mod.rs
src/tests.rs
src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,3 @@ pub mod types;

#[cfg(feature = "server")]
pub(crate) mod header;

#[cfg(test)]
mod tests;

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ src/header.rs
src/lib.rs
src/models.rs
src/server/mod.rs
src/tests.rs
src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,3 @@ pub mod types;

#[cfg(feature = "server")]
pub(crate) mod header;

#[cfg(test)]
mod tests;

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ src/header.rs
src/lib.rs
src/models.rs
src/server/mod.rs
src/tests.rs
src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,3 @@ pub mod types;

#[cfg(feature = "server")]
pub(crate) mod header;

#[cfg(test)]
mod tests;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use openapi_v3::models::OneOfGet200Response;

#[test]
fn test_oneof_schema_untagged() {
use crate::models::OneOfGet200Response;

#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
struct Test {
value: OneOfGet200Response,
Expand Down Expand Up @@ -34,8 +34,3 @@ fn test_oneof_schema_untagged() {
test6
);
}

#[tokio::test]
async fn tokio_test() {
assert!(true);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ src/header.rs
src/lib.rs
src/models.rs
src/server/mod.rs
src/tests.rs
src/types.rs
3 changes: 0 additions & 3 deletions samples/server/petstore/rust-axum/output/ops-v3/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,3 @@ pub mod types;

#[cfg(feature = "server")]
pub(crate) mod header;

#[cfg(test)]
mod tests;
9 changes: 0 additions & 9 deletions samples/server/petstore/rust-axum/output/ops-v3/src/tests.rs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ src/header.rs
src/lib.rs
src/models.rs
src/server/mod.rs
src/tests.rs
src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,3 @@ pub mod types;

#[cfg(feature = "server")]
pub(crate) mod header;

#[cfg(test)]
mod tests;

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ src/header.rs
src/lib.rs
src/models.rs
src/server/mod.rs
src/tests.rs
src/types.rs
3 changes: 0 additions & 3 deletions samples/server/petstore/rust-axum/output/petstore/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,3 @@ pub mod types;

#[cfg(feature = "server")]
pub(crate) mod header;

#[cfg(test)]
mod tests;

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ src/header.rs
src/lib.rs
src/models.rs
src/server/mod.rs
src/tests.rs
src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,3 @@ pub mod types;

#[cfg(feature = "server")]
pub(crate) mod header;

#[cfg(test)]
mod tests;

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ src/header.rs
src/lib.rs
src/models.rs
src/server/mod.rs
src/tests.rs
src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,3 @@ pub mod types;

#[cfg(feature = "server")]
pub(crate) mod header;

#[cfg(test)]
mod tests;

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ src/header.rs
src/lib.rs
src/models.rs
src/server/mod.rs
src/tests.rs
src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,3 @@ pub mod types;

#[cfg(feature = "server")]
pub(crate) mod header;

#[cfg(test)]
mod tests;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use rust_axum_oneof::models::*;

#[test]
fn test_oneof_schema_with_discriminator() {
use crate::models::*;

let test0 = r#"{"op": "ignored", "d": {"welcome_message": "test0"}}"#;

let test1 = r#"{"op": "Hello", "d": {"welcome_message": "test1"}}"#;
Expand Down Expand Up @@ -94,8 +94,3 @@ fn test_oneof_schema_with_discriminator() {
test15
);
}

#[tokio::test]
async fn tokio_test() {
assert!(true);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ src/header.rs
src/lib.rs
src/models.rs
src/server/mod.rs
src/tests.rs
src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,3 @@ pub mod types;

#[cfg(feature = "server")]
pub(crate) mod header;

#[cfg(test)]
mod tests;

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ src/header.rs
src/lib.rs
src/models.rs
src/server/mod.rs
src/tests.rs
src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,3 @@ pub mod types;

#[cfg(feature = "server")]
pub(crate) mod header;

#[cfg(test)]
mod tests;

This file was deleted.

0 comments on commit 29f7c2e

Please sign in to comment.