diff --git a/sandbox/grist/test_summary.py b/sandbox/grist/test_summary.py index d8d0601b..735c6897 100644 --- a/sandbox/grist/test_summary.py +++ b/sandbox/grist/test_summary.py @@ -73,6 +73,7 @@ class TestSummary(test_engine.EngineTestCase): #---------------------------------------------------------------------- + @test_engine.test_undo def test_create_view_section(self): self.load_sample(self.sample) @@ -245,6 +246,7 @@ class Address: #---------------------------------------------------------------------- + @test_engine.test_undo def test_summary_table_reuse(self): # Test that we'll reuse a suitable summary table when already available. @@ -316,6 +318,7 @@ class Address: #---------------------------------------------------------------------- + @test_engine.test_undo def test_summary_no_invalid_reuse(self): # Verify that if we have some summary tables for one table, they don't mistakenly get used # when we need a summary for another table. @@ -399,6 +402,7 @@ class Address: #---------------------------------------------------------------------- + @test_engine.test_undo def test_summary_updates(self): # Verify that summary tables update automatically when we change a value used in a summary # formula; or a value in a group-by column; or add/remove a record; that records get @@ -516,6 +520,7 @@ class Address: #---------------------------------------------------------------------- + @test_engine.test_undo def test_table_rename(self): # Verify that summary tables keep working and updating when source table is renamed. @@ -557,6 +562,7 @@ class Address: #---------------------------------------------------------------------- + @test_engine.test_undo def test_table_rename_multiple(self): # Similar to the above, verify renames, but now with two summary tables. @@ -596,6 +602,7 @@ class Address: #---------------------------------------------------------------------- + @test_engine.test_undo def test_change_summary_formula(self): # Verify that changing a summary formula affects all group-by variants, and adding a new # summary table gets the changed formula. @@ -706,6 +713,7 @@ class Address: ]) #---------------------------------------------------------------------- + @test_engine.test_undo def test_convert_source_column(self): # Verify that we can convert the type of a column when there is a summary table using that # column to group by. Since converting generates extra summary records, this may cause bugs. diff --git a/sandbox/grist/test_summary2.py b/sandbox/grist/test_summary2.py index 79c8ac00..ada27b91 100644 --- a/sandbox/grist/test_summary2.py +++ b/sandbox/grist/test_summary2.py @@ -19,6 +19,7 @@ class TestSummary2(test_engine.EngineTestCase): starting_table_data = test_summary.TestSummary.starting_table_data + @test_engine.test_undo def test_add_summary_formula(self): # Verify that we can add a summary formula; that new sections automatically get columns # matching the source table, and not other columns. Check that group-by columns override @@ -162,6 +163,7 @@ class TestSummary2(test_engine.EngineTestCase): #---------------------------------------------------------------------- + @test_engine.test_undo def test_summary_col_rename(self): # Verify that renaming a column in a source table causes appropriate renames in the summary # tables, and that renames of group-by columns in summary tables are disallowed. @@ -328,6 +330,7 @@ class TestSummary2(test_engine.EngineTestCase): [21, 'foo3', True, 'WidgetOptions2'], ], rows=lambda r: r.colId in ('foo2', 'foo3')) + @test_engine.test_undo def test_summary_col_rename_conflict(self): sample = testutil.parse_test_sample({ "SCHEMA": [ @@ -418,6 +421,7 @@ class TestSummary2(test_engine.EngineTestCase): tables = [table1, fake_summary, summary_by_a_and_b, summary_by_a] self.assertTables(tables) + @test_engine.test_undo def test_source_table_rename_conflict(self): sample = testutil.parse_test_sample({ "SCHEMA": [ @@ -469,6 +473,7 @@ class TestSummary2(test_engine.EngineTestCase): #---------------------------------------------------------------------- + @test_engine.test_undo def test_restrictions(self): # Verify various restrictions on summary tables # (1) no adding/removing/renaming non-formula columns. @@ -553,6 +558,7 @@ class TestSummary2(test_engine.EngineTestCase): #---------------------------------------------------------------------- + @test_engine.test_undo def test_update_summary_section(self): # Verify that we can change the group-by for a view section, and that unused tables get # removed. @@ -876,6 +882,7 @@ class TestSummary2(test_engine.EngineTestCase): #---------------------------------------------------------------------- + @test_engine.test_undo def test_update_groupby_override(self): # Verify that if we add a group-by column that conflicts with a formula, group-by column wins. @@ -939,6 +946,7 @@ class TestSummary2(test_engine.EngineTestCase): #---------------------------------------------------------------------- + @test_engine.test_undo def test_cleanup_on_view_remove(self): # Verify that if we remove a view, that unused summary tables get cleaned up. @@ -1067,6 +1075,7 @@ class TestSummary2(test_engine.EngineTestCase): ]) #---------------------------------------------------------------------- + @test_engine.test_undo def test_detach_summary_section(self): # Verify that "DetachSummaryViewSection" useraction works correctly. @@ -1185,6 +1194,7 @@ class TestSummary2(test_engine.EngineTestCase): ]) #---------------------------------------------------------------------- + @test_engine.test_undo def test_summary_of_detached(self): # Verify that we can make a summary table of a detached table. This is mainly to ensure that # we handle well the presence of columns like 'group' and 'count' in the source table. diff --git a/sandbox/grist/test_summary_choicelist.py b/sandbox/grist/test_summary_choicelist.py index 1c0914d4..be0171da 100644 --- a/sandbox/grist/test_summary_choicelist.py +++ b/sandbox/grist/test_summary_choicelist.py @@ -5,7 +5,7 @@ import column import logger import lookup import testutil -from test_engine import EngineTestCase, Table, Column +from test_engine import EngineTestCase, Table, Column, test_undo log = logger.Logger(__name__, logger.INFO) @@ -35,6 +35,7 @@ class TestSummaryChoiceList(EngineTestCase): # ---------------------------------------------------------------------- + @test_undo def test_summary_by_choice_list(self): self.load_sample(self.sample) @@ -306,6 +307,7 @@ class TestSummaryChoiceList(EngineTestCase): self.assertTableData('Table1', data=summary_data, cols="subset") + @test_undo def test_change_choice_to_choicelist(self): sample = testutil.parse_test_sample({ "SCHEMA": [ @@ -369,6 +371,7 @@ class TestSummaryChoiceList(EngineTestCase): self.assertTables([starting_table, summary_table]) self.assertTableData('Source_summary_choices1', data=data) + @test_undo def test_rename_choices(self): self.load_sample(self.sample)