1212 ctx_http_handler ,
1313)
1414from test .utils .httpservermock import ServedBaseHTTPServerMock
15+ from test .utils .namespace import EGDO
1516from test .utils .wildcard import URL_PARSE_RESULT_WILDCARD
1617from urllib .error import HTTPError
1718
1819import pytest
1920
20- from rdflib import Graph , Namespace
21+ from rdflib import Graph
2122
2223"""
2324Test that correct content negotiation headers are passed
6162 ]
6263 """
6364
64- EG = Namespace ("http://example.org/" )
65-
6665
6766class ContentNegotiationHandler (BaseHTTPRequestHandler ):
6867 def do_GET (self ): # noqa: N802
@@ -106,7 +105,7 @@ def log_message(self, *args):
106105class TestGraphHTTP :
107106 def test_content_negotiation (self ) -> None :
108107 expected = Graph ()
109- expected .add ((EG .a , EG .b , EG .c ))
108+ expected .add ((EGDO .a , EGDO .b , EGDO .c ))
110109 expected_triples = GraphHelper .triple_set (expected )
111110
112111 with ctx_http_handler (ContentNegotiationHandler ) as server :
@@ -121,7 +120,7 @@ def test_content_negotiation(self) -> None:
121120
122121 def test_content_negotiation_no_format (self ) -> None :
123122 expected = Graph ()
124- expected .add ((EG .a , EG .b , EG .c ))
123+ expected .add ((EGDO .a , EGDO .b , EGDO .c ))
125124 expected_triples = GraphHelper .triple_set (expected )
126125
127126 with ctx_http_handler (ContentNegotiationHandler ) as server :
@@ -135,7 +134,7 @@ def test_content_negotiation_no_format(self) -> None:
135134
136135 def test_source (self ) -> None :
137136 expected = Graph ()
138- expected .add ((EG ["a" ], EG ["b" ], EG ["c" ]))
137+ expected .add ((EGDO ["a" ], EGDO ["b" ], EGDO ["c" ]))
139138 expected_triples = GraphHelper .triple_set (expected )
140139
141140 with ServedBaseHTTPServerMock () as httpmock :
@@ -145,7 +144,7 @@ def test_source(self) -> None:
145144 MockHTTPResponse (
146145 200 ,
147146 "OK" ,
148- f"<{ EG ['a' ]} > <{ EG ['b' ]} > <{ EG ['c' ]} >." .encode (),
147+ f"<{ EGDO ['a' ]} > <{ EGDO ['b' ]} > <{ EGDO ['c' ]} >." .encode (),
149148 {"Content-Type" : ["text/turtle" ]},
150149 )
151150 )
@@ -155,7 +154,7 @@ def test_source(self) -> None:
155154
156155 def test_3xx (self ) -> None :
157156 expected = Graph ()
158- expected .add ((EG ["a" ], EG ["b" ], EG ["c" ]))
157+ expected .add ((EGDO ["a" ], EGDO ["b" ], EGDO ["c" ]))
159158 expected_triples = GraphHelper .triple_set (expected )
160159
161160 with ServedBaseHTTPServerMock () as httpmock :
@@ -193,7 +192,7 @@ def test_3xx(self) -> None:
193192 MockHTTPResponse (
194193 200 ,
195194 "OK" ,
196- f"<{ EG ['a' ]} > <{ EG ['b' ]} > <{ EG ['c' ]} >." .encode (),
195+ f"<{ EGDO ['a' ]} > <{ EGDO ['b' ]} > <{ EGDO ['c' ]} >." .encode (),
197196 {"Content-Type" : ["text/turtle" ]},
198197 )
199198 )
0 commit comments