From 0e02f82665d7d584ef13fabfb940396ea1649f1a Mon Sep 17 00:00:00 2001 From: Pradeep Chhetri Date: Sun, 29 Jan 2023 08:40:24 +0800 Subject: [PATCH] Add test for zip archive with bad settings --- tests/integration/test_backup_restore_new/test.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/integration/test_backup_restore_new/test.py b/tests/integration/test_backup_restore_new/test.py index 90e8acc702d..ed27b11529f 100644 --- a/tests/integration/test_backup_restore_new/test.py +++ b/tests/integration/test_backup_restore_new/test.py @@ -430,6 +430,17 @@ def test_zip_archive_with_settings(): assert instance.query("SELECT count(), sum(x) FROM test.table") == "100\t4950\n" +def test_zip_archive_with_bad_settings(): + backup_name = f"Disk('backups', 'archive_with_bad_settings.zip')" + create_and_fill_table() + + assert instance.query("SELECT count(), sum(x) FROM test.table") == "100\t4950\n" + instance.query( + f"BACKUP TABLE test.table TO {backup_name} SETTINGS id='archive_with_bad_settings', compression_method='foobar'" + ) + assert instance.query("SELECT status FROM system.backups WHERE id='archive_with_bad_settings'") == "BACKUP_FAILED\n" + + def test_async(): create_and_fill_table() assert instance.query("SELECT count(), sum(x) FROM test.table") == "100\t4950\n"