diff --git a/tests/conftest.py b/tests/conftest.py index b4eb30d2..0d7cb9c9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -109,5 +109,7 @@ def config(request, tmpdir): 'db_path': ':memory:', 'autocomplete_activities_range': 30, 'autocomplete_split_activity': False, + 'tracking_show_recent_activities': True, + 'tracking_recent_activities_items': 6, } return config diff --git a/tests/preferences/conftest.py b/tests/preferences/conftest.py index 533ce09a..94df22cc 100644 --- a/tests/preferences/conftest.py +++ b/tests/preferences/conftest.py @@ -80,11 +80,24 @@ def autocomplete_split_activity_parametrized(request): return request.param +@pytest.fixture(params=(True, False)) +def tracking_show_recent_activities_parametrized(request): + """Return a parametrized tracking_show_recent_activities_parametrized value.""" + return request.param + + +@pytest.fixture(params=(0, 1, 5, 15)) +def tracking_recent_activities_items_parametrized(request): + """Return a parametrized tracking_recent_activities_items_parametrized value.""" + return request.param + + @pytest.fixture def config_parametrized(request, store_parametrized, day_start_parametrized, fact_min_delta_parametrized, tmpfile_path_parametrized, db_engine_parametrized, db_path_parametrized, autocomplete_activities_range_parametrized, - autocomplete_split_activity_parametrized): + autocomplete_split_activity_parametrized, tracking_show_recent_activities_parametrized, + tracking_recent_activities_items_parametrized): """Return a config fixture with heavily parametrized config values.""" return { 'store': store_parametrized, @@ -95,6 +108,8 @@ def config_parametrized(request, store_parametrized, day_start_parametrized, 'db_path': db_path_parametrized, 'autocomplete_activities_range': autocomplete_activities_range_parametrized, 'autocomplete_split_activity': autocomplete_split_activity_parametrized, + 'tracking_show_recent_activities': tracking_show_recent_activities_parametrized, + 'tracking_recent_activities_items': tracking_recent_activities_items_parametrized, } diff --git a/tests/preferences/test_preferences_dialog.py b/tests/preferences/test_preferences_dialog.py index 7582c380..b920d356 100644 --- a/tests/preferences/test_preferences_dialog.py +++ b/tests/preferences/test_preferences_dialog.py @@ -19,8 +19,9 @@ def test_init(self, dummy_window, app, config, empty_initial): grids = result.get_content_area().get_children()[0].get_children() # This assumes 2 children per config entry (label and widget). grid_entry_counts = [len(g.get_children()) / 2 for g in grids] - assert sum(grid_entry_counts) == 8 + assert sum(grid_entry_counts) == 10 + @pytest.mark.slowtest def test_get_config(self, preferences_dialog, config_parametrized): """ Make sure retrieval of field values works as expected. @@ -32,6 +33,7 @@ def test_get_config(self, preferences_dialog, config_parametrized): result = preferences_dialog.get_config() assert result == config_parametrized + @pytest.mark.slowtest def test_set_config(self, preferences_dialog, config_parametrized): """Make sure setting the field values works as expected.""" preferences_dialog._set_config(config_parametrized) diff --git a/tests/test_hamster-gtk.py b/tests/test_hamster-gtk.py index 1df583a5..8f7f7c4c 100755 --- a/tests/test_hamster-gtk.py +++ b/tests/test_hamster-gtk.py @@ -29,7 +29,7 @@ def test__reload_config(self, app, config, mocker): def test__get_default_config(self, app, appdirs): """Make sure the defaults use appdirs for relevant paths.""" result = app._get_default_config() - assert len(result) == 8 + assert len(result) == 10 assert os.path.dirname(result['tmpfile_path']) == appdirs.user_data_dir assert os.path.dirname(result['db_path']) == appdirs.user_data_dir