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

Function test_drop_table

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

Source from the content-addressed store, hash-verified

339
340#[tokio::test]
341async fn test_drop_table() {
342 let ctx = setup_test_server(vec!["default"]).await;
343
344 // Add a table
345 ctx.server.add_table("default", "table_to_drop");
346
347 // Verify table exists
348 let tables = ctx.api.list_tables("default").await.unwrap();
349 assert!(tables.contains(&"table_to_drop".to_string()));
350
351 // Drop table
352 let result = ctx
353 .api
354 .drop_table(&Identifier::new("default", "table_to_drop"))
355 .await;
356 assert!(result.is_ok(), "failed to drop table: {result:?}");
357
358 // Verify table is gone
359 let tables = ctx.api.list_tables("default").await.unwrap();
360 assert!(!tables.contains(&"table_to_drop".to_string()));
361
362 // Dropping non-existent table should fail
363 let result = ctx
364 .api
365 .drop_table(&Identifier::new("default", "table_to_drop"))
366 .await;
367 assert!(result.is_err(), "dropping non-existent table should fail");
368}
369
370#[tokio::test]
371async fn test_drop_table_no_permission() {

Callers

nothing calls this directly

Calls 4

setup_test_serverFunction · 0.85
add_tableMethod · 0.80
list_tablesMethod · 0.45
drop_tableMethod · 0.45

Tested by

no test coverage detected