Skip to content

Commit ee7dc91

Browse files
Asserts in PostgresNode.set_auto_conf are added
Let's control a correct usage of this function. Plus one assert was added in _escape_config_value.
1 parent a4092af commit ee7dc91

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

testgres/node.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,6 +1634,10 @@ def set_auto_conf(self, options, config='postgresql.auto.conf', rm_options={}):
16341634
current_options[name] = var
16351635

16361636
for option in options:
1637+
assert type(option) == str
1638+
assert option != ""
1639+
assert option.strip() == option
1640+
16371641
value = options[option]
16381642
valueType = type(value)
16391643

@@ -1695,6 +1699,8 @@ def _get_bin_path(self, filename):
16951699
return bin_path
16961700

16971701
def _escape_config_value(value):
1702+
assert type(value) == str
1703+
16981704
result = "'"
16991705

17001706
for ch in value:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy