Projet

Général

Profil

0004-tests-keep-new-table-contents-during-tests-38067.patch

Benjamin Dauvergne, 03 décembre 2019 15:11

Télécharger (1,25 ko)

Voir les différences:

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(+)
tests/test_schema2.py
42 42
    visualization_page = response.click(lambda x: x == visualization)
43 43
    assert 'big-msg-info' not in visualization_page
44 44
    table = get_table(visualization_page)
45
    d = {}
46
    new_table_path = 'tests/fixtures/schema2/new_tables.json'
47
    if os.path.exists(new_table_path):
48
        with open(new_table_path) as fd:
49
            d = json.load(fd)
50
        if 'tables' in d:
51
            d = d['tables']
52
    d[visualization] = table
53
    with open(new_table_path, 'w') as fd:
54
        json.dump(d, fd, indent=4, sort_keys=True)
45 55
    assert_equal_tables(
46 56
        schema2['tables'][visualization],
47 57
        table)
48
-