(self)
| 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 | ''') |
| 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 | ''' |
| 1087 | SELECT cfg::Config.boolprop |
| 1088 | ''', |
| 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 | ''' |
| 1104 | SELECT cfg::Config.boolprop |
| 1105 | ''', |
| 1106 | [value], |
| 1107 | ) |
| 1108 | finally: |
| 1109 | await con2.aclose() |
| 1110 | |
| 1111 | async def test_server_proto_configure_describe_system_config(self): |
| 1112 | try: |
nothing calls this directly
no test coverage detected