Skip to content

Commit

Permalink
Fix mutation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 committed Apr 29, 2024
1 parent 85a2547 commit bb16a34
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 15 deletions.
13 changes: 8 additions & 5 deletions examples/mysql/tests/mutation_tests.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
use async_graphql::{dynamic::*, Response};
use sea_orm::Database;

async fn main() {
test_simple_insert_one().await;
test_complex_insert_one().await;
test_create_batch_mutation().await;
test_update_mutation().await;
test_delete_mutation().await;
}

pub async fn get_schema() -> Schema {
let database = Database::connect("mysql://sea:[email protected]/sakila")
.await
Expand All @@ -19,7 +27,6 @@ pub fn assert_eq(a: Response, b: &str) {
)
}

#[tokio::test]
async fn test_simple_insert_one() {
let schema = get_schema().await;

Expand Down Expand Up @@ -102,7 +109,6 @@ async fn test_simple_insert_one() {
);
}

#[tokio::test]
async fn test_complex_insert_one() {
let schema = get_schema().await;

Expand Down Expand Up @@ -209,7 +215,6 @@ async fn test_complex_insert_one() {
);
}

#[tokio::test]
async fn test_create_batch_mutation() {
let schema = get_schema().await;

Expand Down Expand Up @@ -354,7 +359,6 @@ async fn test_create_batch_mutation() {
)
}

#[tokio::test]
async fn test_update_mutation() {
let schema = get_schema().await;

Expand Down Expand Up @@ -533,7 +537,6 @@ async fn test_update_mutation() {
);
}

#[tokio::test]
async fn test_delete_mutation() {
let schema = get_schema().await;

Expand Down
14 changes: 9 additions & 5 deletions examples/postgres/tests/mutation_tests.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
use async_graphql::{dynamic::*, Response};
use sea_orm::Database;

#[tokio::test]
async fn main() {
test_simple_insert_one().await;
test_complex_insert_one().await;
test_create_batch_mutation().await;
test_update_mutation().await;
test_delete_mutation().await;
}

pub async fn get_schema() -> Schema {
let database = Database::connect("postgres://sea:[email protected]/sakila")
.await
Expand All @@ -19,7 +28,6 @@ pub fn assert_eq(a: Response, b: &str) {
)
}

#[tokio::test]
async fn test_simple_insert_one() {
let schema = get_schema().await;

Expand Down Expand Up @@ -102,7 +110,6 @@ async fn test_simple_insert_one() {
);
}

#[tokio::test]
async fn test_complex_insert_one() {
let schema = get_schema().await;

Expand Down Expand Up @@ -209,7 +216,6 @@ async fn test_complex_insert_one() {
);
}

#[tokio::test]
async fn test_create_batch_mutation() {
let schema = get_schema().await;

Expand Down Expand Up @@ -343,7 +349,6 @@ async fn test_create_batch_mutation() {
)
}

#[tokio::test]
async fn test_update_mutation() {
let schema = get_schema().await;

Expand Down Expand Up @@ -490,7 +495,6 @@ async fn test_update_mutation() {
);
}

#[tokio::test]
async fn test_delete_mutation() {
let schema = get_schema().await;

Expand Down
14 changes: 9 additions & 5 deletions examples/sqlite/tests/mutation_tests.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
use async_graphql::{dynamic::*, Response};
use sea_orm::Database;

#[tokio::test]
async fn main() {
test_simple_insert_one().await;
test_complex_insert_one().await;
test_create_batch_mutation().await;
test_update_mutation().await;
test_delete_mutation().await;
}

pub async fn get_schema() -> Schema {
let database = Database::connect("sqlite://sakila.db").await.unwrap();
let schema = seaography_sqlite_example::query_root::schema(database, None, None).unwrap();
Expand All @@ -15,7 +24,6 @@ pub fn assert_eq(a: Response, b: &str) {
)
}

#[tokio::test]
async fn test_simple_insert_one() {
let schema = get_schema().await;

Expand Down Expand Up @@ -98,7 +106,6 @@ async fn test_simple_insert_one() {
);
}

#[tokio::test]
async fn test_complex_insert_one() {
let schema = get_schema().await;

Expand Down Expand Up @@ -211,7 +218,6 @@ async fn test_complex_insert_one() {
);
}

#[tokio::test]
async fn test_create_batch_mutation() {
let schema = get_schema().await;

Expand Down Expand Up @@ -314,7 +320,6 @@ async fn test_create_batch_mutation() {
);
}

#[tokio::test]
async fn test_update_mutation() {
let schema = get_schema().await;

Expand Down Expand Up @@ -493,7 +498,6 @@ async fn test_update_mutation() {
);
}

#[tokio::test]
async fn test_delete_mutation() {
let schema = get_schema().await;

Expand Down

0 comments on commit bb16a34

Please sign in to comment.