MCPcopy Create free account
hub / github.com/apache/paimon-rust / test_drop_database

Function test_drop_database

crates/paimon/tests/rest_api_test.rs:205–226  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

203
204#[tokio::test]
205async fn test_drop_database() {
206 let ctx = setup_test_server(vec!["default", "to_drop"]).await;
207
208 // Verify database exists
209 let dbs = ctx.api.list_databases().await.unwrap();
210 assert!(dbs.contains(&"to_drop".to_string()));
211
212 // Drop database
213 let result = ctx.api.drop_database("to_drop").await;
214 assert!(result.is_ok(), "failed to drop database: {result:?}");
215
216 // Verify database is gone
217 let dbs = ctx.api.list_databases().await.unwrap();
218 assert!(!dbs.contains(&"to_drop".to_string()));
219
220 // Dropping non-existent database should fail
221 let result = ctx.api.drop_database("to_drop").await;
222 assert!(
223 result.is_err(),
224 "dropping non-existent database should fail"
225 );
226}
227
228#[tokio::test]
229async fn test_drop_database_no_permission() {

Callers

nothing calls this directly

Calls 3

setup_test_serverFunction · 0.85
list_databasesMethod · 0.45
drop_databaseMethod · 0.45

Tested by

no test coverage detected