mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Compatibility with ydiff==1.4.2 (#3216)
1. Implemented compatibility. 2. Constrained the upper version in requirements.txt to avoid future failures. 3. Setup an additional pipeline to check with the latest ydiff. Close #3209 Close #3212 Close #3218
This commit is contained in:
@@ -689,6 +689,17 @@ class TestCtl(unittest.TestCase):
|
||||
show_diff(b"foo:\n bar: \xc3\xb6\xc3\xb6\n".decode('utf-8'),
|
||||
b"foo:\n bar: \xc3\xbc\xc3\xbc\n".decode('utf-8'))
|
||||
|
||||
@patch('subprocess.Popen')
|
||||
@patch('os.environ.get', Mock(return_value='cat'))
|
||||
@patch('sys.stdout.isatty', Mock(return_value=True))
|
||||
@patch('shutil.which', Mock(return_value='cat'))
|
||||
def test_show_diff_pager(self, mock_popen):
|
||||
show_diff("foo:\n bar: 1\n", "foo:\n bar: 2\n")
|
||||
self.assertEqual(mock_popen.return_value.stdin.write.call_count, 6)
|
||||
self.assertIn(b' bar: ', mock_popen.return_value.stdin.write.call_args_list[5][0][0])
|
||||
self.assertIn(b' bar: ', mock_popen.return_value.stdin.write.call_args_list[4][0][0])
|
||||
self.assertIn(b' foo:', mock_popen.return_value.stdin.write.call_args_list[3][0][0])
|
||||
|
||||
@patch('subprocess.call', return_value=1)
|
||||
def test_invoke_editor(self, mock_subprocess_call):
|
||||
os.environ.pop('EDITOR', None)
|
||||
|
||||
Reference in New Issue
Block a user