@@ -823,3 +823,40 @@ def test_drop_nonexistent_namespace(test_catalog: Catalog) -> None:
823823 namespace = ("non_existent_namespace" ,)
824824 with pytest .raises (NoSuchNamespaceError ):
825825 test_catalog .drop_namespace (namespace )
826+
827+
828+ @pytest .mark .integration
829+ @pytest .mark .parametrize ("test_catalog" , CATALOGS )
830+ def test_rename_table_missing_source_table (test_catalog : Catalog , table_name : str , database_name : str ) -> None :
831+ test_catalog .create_namespace_if_not_exists (database_name )
832+ identifier = (database_name , table_name )
833+ new_identifier = (database_name , f"rename-{ table_name } " )
834+
835+ with pytest .raises (NoSuchTableError ):
836+ test_catalog .rename_table (identifier , new_identifier )
837+
838+
839+ @pytest .mark .integration
840+ @pytest .mark .parametrize ("test_catalog" , CATALOGS )
841+ def test_rename_table_destination_namespace_missing (
842+ test_catalog : Catalog , table_schema_nested : Schema , table_name : str , database_name : str
843+ ) -> None :
844+ test_catalog .create_namespace_if_not_exists (database_name )
845+ identifier = (database_name , table_name )
846+ test_catalog .create_table (identifier , table_schema_nested )
847+
848+ new_database_name = "non_existent_namespace"
849+ new_identifier = (new_database_name , table_name )
850+
851+ with pytest .raises (NoSuchNamespaceError ):
852+ test_catalog .rename_table (identifier , new_identifier )
853+
854+
855+ @pytest .mark .integration
856+ @pytest .mark .parametrize ("test_catalog" , CATALOGS )
857+ def test_load_missing_table (test_catalog : Catalog , database_name : str , table_name : str ) -> None :
858+ test_catalog .create_namespace_if_not_exists (database_name )
859+ identifier = (database_name , table_name )
860+
861+ with pytest .raises (NoSuchTableError ):
862+ test_catalog .load_table (identifier )
0 commit comments