Skip to content

Commit 61d3ff8

Browse files
author
Ivan Lazarev
committed
[PBCKP-145] demo for node.execute() instead of node.safe_psql() to avoid .decode('utf-8').rstrip() conversion
1 parent b09b22c commit 61d3ff8

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tests/exclude.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,9 @@ def test_exclude_unlogged_tables_2(self):
235235
'postgres',
236236
'insert into test select generate_series(0,20050000)::text')
237237

238-
rel_path = node.safe_psql(
238+
rel_path = node.execute(
239239
'postgres',
240-
"select pg_relation_filepath('test')").decode('utf-8').rstrip()
240+
"select pg_relation_filepath('test')")[0][0]
241241

242242
backup_id = self.backup_node(
243243
backup_dir, 'node', node,
@@ -274,10 +274,11 @@ def test_exclude_unlogged_tables_2(self):
274274
node.slow_start()
275275

276276
self.assertEqual(
277-
node.safe_psql(
277+
node.execute(
278278
'postgres',
279-
'select count(*) from test').decode('utf-8').rstrip(),
280-
'0')
279+
# TODO REVIEW unfortunately this make auto conversion from string to int, it's weird for me
280+
'select count(*) from test')[0][0],
281+
0)
281282

282283
# Clean after yourself
283284
self.del_test_dir(module_name, fname)

0 commit comments

Comments
 (0)