55This is needed for patterns like localize() where we want to hide
66all inner variables while still executing the inner query.
77"""
8+
89import pytest
910
1011from terminusdb_client import Client
@@ -17,17 +18,17 @@ def select_empty_db():
1718 # Use local server at 6363 (started with TERMINUSDB_AUTOLOGIN=true)
1819 client = Client ("http://127.0.0.1:6363" )
1920 client .connect ()
20-
21+
2122 db_name = "db__test_select_empty"
22-
23+
2324 # Create test database if it doesn't exist
2425 if db_name not in client .list_databases ():
2526 client .create_database (db_name )
2627 else :
2728 client .connect (db = db_name )
28-
29+
2930 yield client
30-
31+
3132 # Cleanup
3233 try :
3334 client .delete_database (db_name , "admin" )
@@ -50,9 +51,7 @@ def test_select_no_args_returns_empty_bindings(self):
5051 # 2. Execute successfully on server
5152 # 3. Return bindings with no variables (empty dicts)
5253
53- query = WOQLQuery ().select (
54- WOQLQuery ().eq ("v:X" , WOQLQuery ().string ("test" ))
55- )
54+ query = WOQLQuery ().select (WOQLQuery ().eq ("v:X" , WOQLQuery ().string ("test" )))
5655
5756 result = self .client .query (query )
5857
@@ -105,7 +104,9 @@ def test_select_allows_outer_binding_through_unification(self):
105104 WOQLQuery ().select (
106105 WOQLQuery ().woql_and (
107106 WOQLQuery ().eq ("v:Inner" , WOQLQuery ().string ("hidden" )),
108- WOQLQuery ().eq ("v:Inner_Shared_Value" , WOQLQuery ().string ("visible" )),
107+ WOQLQuery ().eq (
108+ "v:Inner_Shared_Value" , WOQLQuery ().string ("visible" )
109+ ),
109110 # Use both variables to ensure query executes
110111 WOQLQuery ().eq ("v:Outer" , "v:Inner_Shared_Value" ),
111112 )
@@ -147,15 +148,19 @@ def test_two_localized_blocks_bind_same_variable_name_different_values(self):
147148 # Two separate localized blocks use the same internal variable name (v:temp)
148149 # but bind it to different values - proving they don't interfere
149150
150- localized1 , v1 = WOQLQuery ().localize ({
151- "result" : "v:result1" ,
152- "temp" : None , # local variable - same name in both blocks
153- })
151+ localized1 , v1 = WOQLQuery ().localize (
152+ {
153+ "result" : "v:result1" ,
154+ "temp" : None , # local variable - same name in both blocks
155+ }
156+ )
154157
155- localized2 , v2 = WOQLQuery ().localize ({
156- "result" : "v:result2" ,
157- "temp" : None , # local variable - same name, different scope
158- })
158+ localized2 , v2 = WOQLQuery ().localize (
159+ {
160+ "result" : "v:result2" ,
161+ "temp" : None , # local variable - same name, different scope
162+ }
163+ )
159164
160165 query = WOQLQuery ().woql_and (
161166 # First localized block: temp = "first", result1 = temp
0 commit comments