@@ -35,48 +35,28 @@ def test_create_client_for_local_metadata(metadata):
3535
3636
3737@responses .activate
38- def test_create_service_application_xml (metadata ):
39- """Check client creation for valid use case with MIME type 'application/xml'"""
38+ @pytest .mark .parametrize ("content_type" , ['application/xml' , 'application/atom+xml' , 'text/xml' ])
39+ def test_create_service_application (metadata , content_type ):
40+ """Check client creation for valid MIME types"""
4041
4142 responses .add (
4243 responses .GET ,
4344 f"{ SERVICE_URL } /$metadata" ,
44- content_type = 'application/xml' ,
45+ content_type = content_type ,
4546 body = metadata ,
4647 status = 200 )
4748
4849 client = pyodata .Client (SERVICE_URL , requests )
4950
5051 assert isinstance (client , pyodata .v2 .service .Service )
5152
52- # onw more test for '/' terminated url
53+ # one more test for '/' terminated url
5354
5455 client = pyodata .Client (SERVICE_URL + '/' , requests )
5556
5657 assert isinstance (client , pyodata .v2 .service .Service )
57- assert client .schema .is_valid == True
58-
59- @responses .activate
60- def test_create_service_text_xml (metadata ):
61- """Check client creation for valid use case with MIME type 'text/xml'"""
62-
63- responses .add (
64- responses .GET ,
65- f"{ SERVICE_URL } /$metadata" ,
66- content_type = 'text/xml' ,
67- body = metadata ,
68- status = 200 )
58+ assert client .schema .is_valid
6959
70- client = pyodata .Client (SERVICE_URL , requests )
71-
72- assert isinstance (client , pyodata .v2 .service .Service )
73-
74- # onw more test for '/' terminated url
75-
76- client = pyodata .Client (SERVICE_URL + '/' , requests )
77-
78- assert isinstance (client , pyodata .v2 .service .Service )
79- assert client .schema .is_valid == True
8060
8161@responses .activate
8262def test_metadata_not_reachable ():
0 commit comments