diff --git a/test/integration_tests/long/test_create_table_executor.py b/test/integration_tests/long/test_create_table_executor.py index 40803f767..1c9f216f7 100644 --- a/test/integration_tests/long/test_create_table_executor.py +++ b/test/integration_tests/long/test_create_table_executor.py @@ -82,6 +82,11 @@ def test_should_create_table_from_select(self): expected_batch = Batch(frames=pd.DataFrame(expected)) self.assertEqual(actual_batch, expected_batch) + execute_query_fetch_all(self.evadb, "DROP TABLE IF EXISTS dummy_table;") + + # re create table should work + execute_query_fetch_all(self.evadb, create_query) + @macos_skip_marker @pytest.mark.torchtest def test_should_create_table_from_select_lateral_join(self): @@ -102,6 +107,12 @@ def test_should_create_table_from_select_lateral_join(self): for idx in res.index: self.assertTrue("car" in res["uadtrac_fastrcnn.label"][idx]) + execute_query_fetch_all(self.evadb, "DROP TABLE IF EXISTS uadtrac_fastRCNN;") + + # re create table should work + query = "CREATE TABLE IF NOT EXISTS " f"uadtrac_fastRCNN AS {select_query};" + execute_query_fetch_all(self.evadb, query) + if __name__ == "__main__": unittest.main() diff --git a/test/integration_tests/short/test_drop_executor.py b/test/integration_tests/short/test_drop_executor.py index a5e19ea53..632aa4a00 100644 --- a/test/integration_tests/short/test_drop_executor.py +++ b/test/integration_tests/short/test_drop_executor.py @@ -112,6 +112,11 @@ def test_should_drop_table(self): self.evadb, drop_query, do_not_print_exceptions=True ) + # we should be able to re-create the table + execute_query_fetch_all(self.evadb, query) + # clean up + execute_query_fetch_all(self.evadb, drop_query) + def run_create_function_query(self): create_function_query = """CREATE FUNCTION DummyObjectDetector INPUT (Frame_Array NDARRAY UINT8(3, 256, 256)) @@ -136,6 +141,11 @@ def test_should_drop_function(self): ) self.assertTrue(function is None) + # We should be able to re-create the function + self.run_create_function_query() + # clean up + execute_query_fetch_all(self.evadb, drop_query) + def test_drop_wrong_function_name(self): self.run_create_function_query() right_function_name = "DummyObjectDetector" @@ -227,3 +237,11 @@ def test_should_drop_database(self): f"DROP DATABASE {database_name}", do_not_print_exceptions=True, ) + + # We should be able to add the database again + execute_query_fetch_all(self.evadb, query) + + # clean up + result = execute_query_fetch_all( + self.evadb, f"DROP DATABASE IF EXISTS {database_name}" + )