@@ -1255,6 +1255,33 @@ async def test_schema_types(registry_async_client: Client, trail: str) -> None:
12551255 assert "PROTOBUF" in json_res
12561256
12571257
1258+ @pytest .mark .parametrize ("trail" , ["" , "/" ])
1259+ async def test_schema_list_endpoint (registry_async_client : Client , trail : str ) -> None :
1260+ """Test schema endpoint list"""
1261+ subject = create_subject_name_factory (f"test_schema_subject_list_endpoint-{ trail } " )()
1262+ unique_field_factory = create_field_name_factory (trail )
1263+
1264+ unique = unique_field_factory ()
1265+ schema_str = json .dumps ({"type" : "string" , "unique" : unique })
1266+ res = await registry_async_client .post (
1267+ f"subjects/{ subject } /versions{ trail } " ,
1268+ json = {"schema" : schema_str },
1269+ )
1270+ assert res .status_code == 200
1271+ assert "id" in res .json ()
1272+ schema_id = res .json ()["id" ]
1273+
1274+ res = await registry_async_client .get ("schemas" )
1275+ assert res .status_code == 200
1276+ result_json = res .json ()
1277+ assert len (result_json ) == 1
1278+ schema_data = result_json [0 ]
1279+ assert schema_data .get ("id" ) == schema_id
1280+ assert schema_data .get ("subject" ) == subject
1281+ assert schema_data .get ("version" ) == 1
1282+ assert schema_data .get ("schema" ) == schema_str
1283+
1284+
12581285@pytest .mark .parametrize ("trail" , ["" , "/" ])
12591286async def test_schema_repost (registry_async_client : Client , trail : str ) -> None :
12601287 """ "
0 commit comments