MCPcopy
hub / github.com/geldata/gel / test_server_proto_configure_09

Method test_server_proto_configure_09

tests/test_server_config.py:1072–1109  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1070 ''')
1071
1072 async def test_server_proto_configure_09(self):
1073 con2 = await self.connect()
1074 default_value = await con2.query_single(
1075 'SELECT assert_single(cfg::Config).boolprop'
1076 )
1077 try:
1078 for value in [True, False, True, False]:
1079 await self.con.execute(f'''
1080 CONFIGURE SESSION SET boolprop := <bool>'{value}';
1081 ''&#x27;)
1082 # The first immediate query is likely NOT syncing in-memory
1083 # state to the backend connection, so this will test that
1084 # the state in the SQL temp table is correctly set.
1085 await self.assert_query_result(
1086 ''&#x27;
1087 SELECT cfg::Config.boolprop
1088 ''&#x27;,
1089 [value],
1090 )
1091 # Now change the state on the backend connection, hopefully,
1092 # by running a query with con2 with different state.
1093 self.assertEqual(
1094 await con2.query_single(
1095 'SELECT assert_single(cfg::Config).boolprop'
1096 ),
1097 default_value,
1098 )
1099 # The second query shall sync in-memory state to the backend
1100 # connection, so this tests if the statically evaluated bool
1101 # value is correct.
1102 await self.assert_query_result(
1103 ''&#x27;
1104 SELECT cfg::Config.boolprop
1105 ''&#x27;,
1106 [value],
1107 )
1108 finally:
1109 await con2.aclose()
1110
1111 async def test_server_proto_configure_describe_system_config(self):
1112 try:

Callers

nothing calls this directly

Calls 4

executeMethod · 0.80
connectMethod · 0.45
assert_query_resultMethod · 0.45
acloseMethod · 0.45

Tested by

no test coverage detected