diff --git a/.vscode/settings.json b/.vscode/settings.json index ae896538..1f46fc1a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,8 +1,13 @@ { "python.defaultInterpreterPath": "${workspaceFolder}/backend-python/.venv", - "workbench.colorCustomizations": { - "titleBar.activeBackground": "#042F2D", - "titleBar.activeForeground": "#ffffff" - }, - "jupyter.notebookFileRoot": "${workspaceFolder}/backend-python/media_impact_monitor" -} + "workbench.colorCustomizations": { + "titleBar.activeBackground": "#042F2D", + "titleBar.activeForeground": "#ffffff" + }, + "jupyter.notebookFileRoot": "${workspaceFolder}/backend-python/media_impact_monitor", + "python.testing.pytestArgs": [ + "backend-python/media_impact_monitor" + ], + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true +} \ No newline at end of file diff --git a/backend-python/media_impact_monitor/trends/keyword_trend.py b/backend-python/media_impact_monitor/trends/keyword_trend.py index e7e424b5..94e8fa72 100644 --- a/backend-python/media_impact_monitor/trends/keyword_trend.py +++ b/backend-python/media_impact_monitor/trends/keyword_trend.py @@ -1,5 +1,3 @@ -from datetime import date - import pandas as pd import yaml @@ -9,7 +7,6 @@ from media_impact_monitor.data_loaders.news_print.genios import get_genios_counts from media_impact_monitor.data_loaders.web.google_trends import get_google_trends_counts from media_impact_monitor.types_ import TrendSearch -from media_impact_monitor.util.cache import cache from media_impact_monitor.util.paths import src diff --git a/backend-python/media_impact_monitor/trends/keyword_trend_test.py b/backend-python/media_impact_monitor/trends/keyword_trend_test.py index e9deefd3..7292b47b 100644 --- a/backend-python/media_impact_monitor/trends/keyword_trend_test.py +++ b/backend-python/media_impact_monitor/trends/keyword_trend_test.py @@ -4,13 +4,14 @@ def test_topic_queries(): for media_source in ["news_online", "news_print"]: queries = topic_queries(media_source) - assert queries["science"].startswith( - "klimawandel OR klimaerwärmung OR erderwärmung" + assert queries["climate science"].startswith( + 'klimaforsch* OR klimawissenschaft*' ) - assert queries["policy"].startswith( - "klimaneutral* OR klimaziel* OR klimaschutzpaket" + assert queries["climate policy"].startswith( + "klimapoliti* OR klimaneutral* OR klimaziel*" ) - assert '"erneuerbare energie*"' in queries["policy"] + assert '"erneuerbare energie*"' in queries["climate policy"] queries = topic_queries("web_google") - assert "-\\*protest*" in queries["all_excl_activism"] - assert "+klimawandel" in queries["all_excl_activism"] + assert "+erderwärmung" in queries["climate science"] + # assert "-\\*protest*" in queries["all_excl_activism"] + # assert "+klimawandel" in queries["all_excl_activism"]