Small refactoring of postgresql/bootstrap (#1086)

the main purpose of this PR is simplifying #1068

It is mostly necessary for future support of pg12, where there will be no recovery.conf anymore, but `keep_existing_recovery_conf` parameter still needs to be supported due to backward compatibility.
This commit is contained in:
Alexander Kukushkin
2019-06-17 10:41:13 +02:00
committed by GitHub
parent 37f03790cc
commit fad6d26a3a
2 changed files with 20 additions and 12 deletions
+2 -1
View File
@@ -186,7 +186,8 @@ class TestBootstrap(BaseTestPostgresql):
'replication': {'username': 'r', 'password': 'r'},
'rewind': {'username': 'rw', 'password': 'rw'}},
'listen': '*', 'retry_timeout': 10, 'parameters': {'wal_level': '', 'hba_file': 'foo'}})
with patch.object(Postgresql, 'restart', Mock()) as mock_restart:
with patch.object(Postgresql, 'major_version', PropertyMock(return_value=110000)), \
patch.object(Postgresql, 'restart', Mock()) as mock_restart:
self.b.post_bootstrap({}, task)
mock_restart.assert_called_once()