|
5 | 5 | from ..testgres.nodeimportPgVer
|
6 | 6 | from ..testgres.nodeimportPostgresNode
|
7 | 7 | from ..testgres.utilsimportget_pg_version2
|
| 8 | +from ..testgres.utilsimportget_pg_config2 |
8 | 9 | from ..testgres.utilsimportfile_tail
|
9 | 10 | from ..testgres.utilsimportget_bin_path2
|
10 | 11 | from ..testgresimportProcessType
|
@@ -1064,6 +1065,31 @@ def test_dump(self, os_ops: OsOperations):
|
1064 | 1065 | res=node3.execute(query_select)
|
1065 | 1066 | assert (res== [(1, ), (2, )])
|
1066 | 1067 |
|
| 1068 | +deftest_get_pg_config2(self,os_ops:OsOperations): |
| 1069 | +# check same instances |
| 1070 | +a=get_pg_config2(os_ops,None) |
| 1071 | +b=get_pg_config2(os_ops,None) |
| 1072 | +assert (id(a)==id(b)) |
| 1073 | + |
| 1074 | +# save right before config change |
| 1075 | +c1=get_pg_config2(os_ops,None) |
| 1076 | + |
| 1077 | +# modify setting for this scope |
| 1078 | +withscoped_config(cache_pg_config=False)asconfig: |
| 1079 | +# sanity check for value |
| 1080 | +assertnot (config.cache_pg_config) |
| 1081 | + |
| 1082 | +# save right after config change |
| 1083 | +c2=get_pg_config2(os_ops,None) |
| 1084 | + |
| 1085 | +# check different instances after config change |
| 1086 | +assert (id(c1)!=id(c2)) |
| 1087 | + |
| 1088 | +# check different instances |
| 1089 | +a=get_pg_config2(os_ops,None) |
| 1090 | +b=get_pg_config2(os_ops,None) |
| 1091 | +assert (id(a)!=id(b)) |
| 1092 | + |
1067 | 1093 | @staticmethod
|
1068 | 1094 | defhelper__get_node(os_ops:OsOperations,name=None):
|
1069 | 1095 | assertisinstance(os_ops,OsOperations)
|
|