From 3e788f072ae6a3151db7b519ce5110f026612c26 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Sat, 30 Nov 2019 03:53:09 +0100 Subject: [PATCH 04/13] tests: keep new table contents during tests (#38067) If table contents change, we can measure the change and eventually accept by copying new_table.json to tables.json. --- tests/test_schema2.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_schema2.py b/tests/test_schema2.py index adaa1a7..d802c31 100644 --- a/tests/test_schema2.py +++ b/tests/test_schema2.py @@ -42,6 +42,16 @@ def test_simple(schema2, app, admin, visualization): visualization_page = response.click(lambda x: x == visualization) assert 'big-msg-info' not in visualization_page table = get_table(visualization_page) + d = {} + new_table_path = 'tests/fixtures/schema2/new_tables.json' + if os.path.exists(new_table_path): + with open(new_table_path) as fd: + d = json.load(fd) + if 'tables' in d: + d = d['tables'] + d[visualization] = table + with open(new_table_path, 'w') as fd: + json.dump(d, fd, indent=4, sort_keys=True) assert_equal_tables( schema2['tables'][visualization], table) -- 2.23.0