Release 1.6.0 (#1131)

* Implement missing tests and do a few minor fixes
* Bump version to 1.6.0
* Update release notes
This commit is contained in:
Alexander Kukushkin
2019-08-05 15:08:04 +02:00
committed by GitHub
parent 0b1b1e3b54
commit 278bf9852b
11 changed files with 149 additions and 25 deletions
+3
View File
@@ -197,3 +197,6 @@ class TestConsul(unittest.TestCase):
d['state'] = 'running'
d['role'] = 'bla'
self.assertIsNone(self.c.update_service({}, d))
def test_reload_config(self):
self.c.reload_config({'consul': {'token': 'foo'}, 'loop_wait': 10, 'ttl': 30, 'retry_timeout': 10})
+7 -5
View File
@@ -25,9 +25,9 @@ CONFIG_FILE_PATH = './test-ctl.yaml'
def test_rw_config():
runner = CliRunner()
with runner.isolated_filesystem():
store_config({'etcd': {'host': 'localhost:2379'}}, CONFIG_FILE_PATH + '/dummy')
sys.argv = ['patronictl.py', '']
load_config(CONFIG_FILE_PATH + '/dummy', None)
store_config({'etcd': {'host': 'localhost:2379'}}, CONFIG_FILE_PATH + '/dummy')
load_config(CONFIG_FILE_PATH + '/dummy', '0.0.0.0')
os.remove(CONFIG_FILE_PATH + '/dummy')
os.rmdir(CONFIG_FILE_PATH)
@@ -95,7 +95,8 @@ class TestCtl(unittest.TestCase):
assert result.exit_code == 1
# Aborting scheduled switchover, as we answer NO to the confirmation
result = self.runner.invoke(ctl, ['switchover', 'dummy', '--scheduled', '2015-01-01T12:00:00+01:00'], input='leader\nother\n\nN')
result = self.runner.invoke(ctl, ['switchover', 'dummy', '--scheduled', '2015-01-01T12:00:00+01:00'],
input='leader\nother\n\nN')
assert result.exit_code == 1
# Target and source are equal
@@ -544,9 +545,10 @@ class TestCtl(unittest.TestCase):
@patch('subprocess.call', return_value=1)
def test_invoke_editor(self, mock_subprocess_call):
for e in ('', 'false'):
os.environ['EDITOR'] = e
self.assertRaises(PatroniCtlException, invoke_editor, 'foo: bar\n', 'test')
os.environ.pop('EDITOR', None)
for e in ('', '/bin/vi'):
with patch('patroni.ctl.find_executable', Mock(return_value=e)):
self.assertRaises(PatroniCtlException, invoke_editor, 'foo: bar\n', 'test')
@patch('patroni.ctl.get_dcs')
def test_show_config(self, mock_get_dcs):