@@ -23,9 +23,11 @@ class _ContextHandler(BaseHTTPRequestHandler):
2323
2424 def do_GET (self ):
2525 type (self ).request_count += 1
26- body = json .dumps ({
27- '@context' : {'name' : 'http://example.org/name' },
28- }).encode ()
26+ body = json .dumps (
27+ {
28+ '@context' : {'name' : 'http://example.org/name' },
29+ }
30+ ).encode ()
2931 self .send_response (200 )
3032 self .send_header ('Content-Type' , 'application/ld+json' )
3133 self .send_header ('Cache-Control' , 'max-age=3600' )
@@ -52,7 +54,8 @@ def context_url():
5254def test_requests_document_loader_accepts_custom_session ():
5355 """RequestsDocumentLoader accepts a CachedSession via session=."""
5456 loader = RequestsDocumentLoader (
55- session = CachedSession (backend = 'memory' , cache_control = True ))
57+ session = CachedSession (backend = 'memory' , cache_control = True )
58+ )
5659 assert isinstance (loader , DocumentLoader )
5760 assert callable (loader )
5861 loader .session .close ()
@@ -70,15 +73,16 @@ def test_sqlite_cache_requests_document_loader_is_document_loader():
7073def test_sqlite_cache_requests_document_loader_rejects_relative_sqlite_file_path ():
7174 """Relative sqlite_file_path is rejected."""
7275 with pytest .raises (ValueError , match = 'absolute path' ):
73- SqliteCacheRequestsDocumentLoader (
74- sqlite_file_path = Path ('relative.sqlite' ))
76+ SqliteCacheRequestsDocumentLoader (sqlite_file_path = Path ('relative.sqlite' ))
7577
7678
7779def test_sqlite_cache_file_path_is_resolved (tmp_path ):
7880 """Absolute sqlite_file_path is normalized to a full path."""
7981 sqlite_file_path = tmp_path / 'cache' / '..' / 'contexts.sqlite'
80- assert _resolve_sqlite_file_path (sqlite_file_path ) == (
81- tmp_path / 'contexts.sqlite' ).resolve ()
82+ assert (
83+ _resolve_sqlite_file_path (sqlite_file_path )
84+ == (tmp_path / 'contexts.sqlite' ).resolve ()
85+ )
8286
8387
8488def test_http_cache_headers_serve_from_cache_with_cache_control (context_url ):
@@ -88,7 +92,8 @@ def test_http_cache_headers_serve_from_cache_with_cache_control(context_url):
8892 'test_memory_cache_control' ,
8993 backend = 'memory' ,
9094 cache_control = True ,
91- ))
95+ )
96+ )
9297 loader (context_url )
9398 loader (context_url )
9499 assert _ContextHandler .request_count == 1
@@ -103,7 +108,8 @@ def test_http_cache_headers_without_cache_control_hits_server_twice(context_url)
103108 backend = 'memory' ,
104109 cache_control = False ,
105110 expire_after = 0 ,
106- ))
111+ )
112+ )
107113 loader (context_url )
108114 loader (context_url )
109115 assert _ContextHandler .request_count == 2
0 commit comments