From 10e067db0190a1d46a628207510a8e1c4de34d35 Mon Sep 17 00:00:00 2001 From: Bill Lovett Date: Tue, 18 Jun 2019 13:49:54 -0400 Subject: [PATCH] Switch to suffix-based naming for test files --- .rsync-filter | 2 +- Makefile | 18 +++++++++--------- apps/azure/{test_main.py => main_test.py} | 0 .../{test_main.py => main_test.py} | 0 apps/bookmarks/{test_main.py => main_test.py} | 0 apps/bounce/{test_main.py => main_test.py} | 0 apps/calls/{test_main.py => main_test.py} | 0 apps/captures/{test_main.py => main_test.py} | 0 apps/countries/{test_main.py => main_test.py} | 0 apps/coverage/{test_main.py => main_test.py} | 0 apps/geodb/{test_main.py => main_test.py} | 0 apps/grids/{test_main.py => main_test.py} | 0 apps/headers/{test_main.py => main_test.py} | 0 apps/headlines/{test_main.py => main_test.py} | 0 apps/homepage/{test_main.py => main_test.py} | 0 apps/htmlhead/{test_main.py => main_test.py} | 0 apps/ip/{test_main.py => main_test.py} | 0 apps/jenkins/{test_main.py => main_test.py} | 0 apps/later/{test_main.py => main_test.py} | 0 apps/logindex/{test_main.py => main_test.py} | 0 .../maintenance/{test_main.py => main_test.py} | 0 .../{test_main.py => main_test.py} | 0 apps/phone/{test_main.py => main_test.py} | 0 apps/redirect/{test_main.py => main_test.py} | 0 apps/registry/{test_main.py => main_test.py} | 0 apps/reminder/{test_main.py => main_test.py} | 0 apps/shared/{test_main.py => main_test.py} | 0 apps/speak/{test_main.py => main_test.py} | 0 apps/startpage/{test_main.py => main_test.py} | 0 apps/transform/{test_main.py => main_test.py} | 0 apps/visitors/{test_main.py => main_test.py} | 0 apps/wakeup/{test_main.py => main_test.py} | 0 apps/weather/{test_main.py => main_test.py} | 0 apps/whois/{test_main.py => main_test.py} | 0 parsers/{test_htmlhead.py => htmlhead_test.py} | 0 parsers/{test_htmltext.py => htmltext_test.py} | 0 .../{test_startpage.py => startpage_test.py} | 0 plugins/{test_markup.py => markup_test.py} | 0 plugins/{test_url.py => url_test.py} | 0 39 files changed, 10 insertions(+), 10 deletions(-) rename apps/azure/{test_main.py => main_test.py} (100%) rename apps/bookmarklets/{test_main.py => main_test.py} (100%) rename apps/bookmarks/{test_main.py => main_test.py} (100%) rename apps/bounce/{test_main.py => main_test.py} (100%) rename apps/calls/{test_main.py => main_test.py} (100%) rename apps/captures/{test_main.py => main_test.py} (100%) rename apps/countries/{test_main.py => main_test.py} (100%) rename apps/coverage/{test_main.py => main_test.py} (100%) rename apps/geodb/{test_main.py => main_test.py} (100%) rename apps/grids/{test_main.py => main_test.py} (100%) rename apps/headers/{test_main.py => main_test.py} (100%) rename apps/headlines/{test_main.py => main_test.py} (100%) rename apps/homepage/{test_main.py => main_test.py} (100%) rename apps/htmlhead/{test_main.py => main_test.py} (100%) rename apps/ip/{test_main.py => main_test.py} (100%) rename apps/jenkins/{test_main.py => main_test.py} (100%) rename apps/later/{test_main.py => main_test.py} (100%) rename apps/logindex/{test_main.py => main_test.py} (100%) rename apps/maintenance/{test_main.py => main_test.py} (100%) rename apps/notification/{test_main.py => main_test.py} (100%) rename apps/phone/{test_main.py => main_test.py} (100%) rename apps/redirect/{test_main.py => main_test.py} (100%) rename apps/registry/{test_main.py => main_test.py} (100%) rename apps/reminder/{test_main.py => main_test.py} (100%) rename apps/shared/{test_main.py => main_test.py} (100%) rename apps/speak/{test_main.py => main_test.py} (100%) rename apps/startpage/{test_main.py => main_test.py} (100%) rename apps/transform/{test_main.py => main_test.py} (100%) rename apps/visitors/{test_main.py => main_test.py} (100%) rename apps/wakeup/{test_main.py => main_test.py} (100%) rename apps/weather/{test_main.py => main_test.py} (100%) rename apps/whois/{test_main.py => main_test.py} (100%) rename parsers/{test_htmlhead.py => htmlhead_test.py} (100%) rename parsers/{test_htmltext.py => htmltext_test.py} (100%) rename parsers/{test_startpage.py => startpage_test.py} (100%) rename plugins/{test_markup.py => markup_test.py} (100%) rename plugins/{test_url.py => url_test.py} (100%) diff --git a/.rsync-filter b/.rsync-filter index b25e6cfe..d71cacb1 100644 --- a/.rsync-filter +++ b/.rsync-filter @@ -10,7 +10,7 @@ - /coverage - /.coverage - /testing -- test_*.py +- *_test.py - /workspace.sh - /.rsync-filter - medley.conf diff --git a/Makefile b/Makefile index 2547889c..8376f5a5 100644 --- a/Makefile +++ b/Makefile @@ -13,17 +13,17 @@ APPS := $(filter-out __%,$(APPS)) APPS := $(addprefix apps., $(APPS)) # A list of parsers with test suites in the form "parsers.[name of parser]". -PARSERS := $(wildcard parsers/test_*.py) +PARSERS := $(wildcard parsers/*_test.py) PARSERS := $(notdir $(PARSERS)) PARSERS := $(basename $(PARSERS)) -PARSERS := $(subst test_,,$(PARSERS)) +PARSERS := $(subst _test,,$(PARSERS)) PARSERS := $(addprefix parsers., $(PARSERS)) # A list of plugins with test suites in the form "plugins.[name of plugin]". -PLUGINS := $(wildcard plugins/test_*.py) +PLUGINS := $(wildcard plugins/*_test.py) PLUGINS := $(notdir $(PLUGINS)) PLUGINS := $(basename $(PLUGINS)) -PLUGINS := $(subst test_,,$(PLUGINS)) +PLUGINS := $(subst _test,,$(PLUGINS)) PLUGINS := $(addprefix plugins., $(PLUGINS)) REQUIREMENTS_PATHS := $(APP_DIR)/requirements* @@ -177,7 +177,7 @@ test: $(APPS) $(PARSERS) $(PLUGINS) coverage # Customizing the name of the coverage file allows Make to skip the # tests if nothing has changed. This is also why the coverage file is # deleted if the tests fail. -apps.%.cov: apps/%/main.py apps/%/test_main.py +apps.%.cov: apps/%/main.py apps/%/main_test.py mkdir -p $(COVERAGE_DIR) COVERAGE_FILE=coverage/$@ \ python -m pytest --cov=apps.$* --cov-branch apps/$* \ @@ -194,10 +194,10 @@ apps.%.cov: apps/%/main.py apps/%/test_main.py # Customizing the name of the coverage file allows Make to skip the # tests if nothing has changed. This is also why the coverage file is # deleted if the tests fail. -parsers.%.cov: parsers/%.py parsers/test_%.py +parsers.%.cov: parsers/%.py parsers/%_test.py mkdir -p $(COVERAGE_DIR) COVERAGE_FILE=coverage/$@ \ - python -m pytest --cov=parsers.$* --cov-branch parsers/test_$*.py \ + python -m pytest --cov=parsers.$* --cov-branch parsers/$*_test.py \ || rm $(COVERAGE_DIR)/$@ @@ -212,10 +212,10 @@ parsers.%.cov: parsers/%.py parsers/test_%.py # Customizing the name of the coverage file allows Make to skip the # tests if nothing has changed. This is also why the coverage file is # deleted if the tests fail. -plugins.%.cov: plugins/%.py plugins/test_%.py +plugins.%.cov: plugins/%.py plugins/%_test.py mkdir -p $(COVERAGE_DIR) COVERAGE_FILE=coverage/$@ \ - python -m pytest --cov=plugins.$* --cov-branch plugins/test_$*.py \ + python -m pytest --cov=plugins.$* --cov-branch plugins/$*_test.py \ || rm $(COVERAGE_DIR)/$@ diff --git a/apps/azure/test_main.py b/apps/azure/main_test.py similarity index 100% rename from apps/azure/test_main.py rename to apps/azure/main_test.py diff --git a/apps/bookmarklets/test_main.py b/apps/bookmarklets/main_test.py similarity index 100% rename from apps/bookmarklets/test_main.py rename to apps/bookmarklets/main_test.py diff --git a/apps/bookmarks/test_main.py b/apps/bookmarks/main_test.py similarity index 100% rename from apps/bookmarks/test_main.py rename to apps/bookmarks/main_test.py diff --git a/apps/bounce/test_main.py b/apps/bounce/main_test.py similarity index 100% rename from apps/bounce/test_main.py rename to apps/bounce/main_test.py diff --git a/apps/calls/test_main.py b/apps/calls/main_test.py similarity index 100% rename from apps/calls/test_main.py rename to apps/calls/main_test.py diff --git a/apps/captures/test_main.py b/apps/captures/main_test.py similarity index 100% rename from apps/captures/test_main.py rename to apps/captures/main_test.py diff --git a/apps/countries/test_main.py b/apps/countries/main_test.py similarity index 100% rename from apps/countries/test_main.py rename to apps/countries/main_test.py diff --git a/apps/coverage/test_main.py b/apps/coverage/main_test.py similarity index 100% rename from apps/coverage/test_main.py rename to apps/coverage/main_test.py diff --git a/apps/geodb/test_main.py b/apps/geodb/main_test.py similarity index 100% rename from apps/geodb/test_main.py rename to apps/geodb/main_test.py diff --git a/apps/grids/test_main.py b/apps/grids/main_test.py similarity index 100% rename from apps/grids/test_main.py rename to apps/grids/main_test.py diff --git a/apps/headers/test_main.py b/apps/headers/main_test.py similarity index 100% rename from apps/headers/test_main.py rename to apps/headers/main_test.py diff --git a/apps/headlines/test_main.py b/apps/headlines/main_test.py similarity index 100% rename from apps/headlines/test_main.py rename to apps/headlines/main_test.py diff --git a/apps/homepage/test_main.py b/apps/homepage/main_test.py similarity index 100% rename from apps/homepage/test_main.py rename to apps/homepage/main_test.py diff --git a/apps/htmlhead/test_main.py b/apps/htmlhead/main_test.py similarity index 100% rename from apps/htmlhead/test_main.py rename to apps/htmlhead/main_test.py diff --git a/apps/ip/test_main.py b/apps/ip/main_test.py similarity index 100% rename from apps/ip/test_main.py rename to apps/ip/main_test.py diff --git a/apps/jenkins/test_main.py b/apps/jenkins/main_test.py similarity index 100% rename from apps/jenkins/test_main.py rename to apps/jenkins/main_test.py diff --git a/apps/later/test_main.py b/apps/later/main_test.py similarity index 100% rename from apps/later/test_main.py rename to apps/later/main_test.py diff --git a/apps/logindex/test_main.py b/apps/logindex/main_test.py similarity index 100% rename from apps/logindex/test_main.py rename to apps/logindex/main_test.py diff --git a/apps/maintenance/test_main.py b/apps/maintenance/main_test.py similarity index 100% rename from apps/maintenance/test_main.py rename to apps/maintenance/main_test.py diff --git a/apps/notification/test_main.py b/apps/notification/main_test.py similarity index 100% rename from apps/notification/test_main.py rename to apps/notification/main_test.py diff --git a/apps/phone/test_main.py b/apps/phone/main_test.py similarity index 100% rename from apps/phone/test_main.py rename to apps/phone/main_test.py diff --git a/apps/redirect/test_main.py b/apps/redirect/main_test.py similarity index 100% rename from apps/redirect/test_main.py rename to apps/redirect/main_test.py diff --git a/apps/registry/test_main.py b/apps/registry/main_test.py similarity index 100% rename from apps/registry/test_main.py rename to apps/registry/main_test.py diff --git a/apps/reminder/test_main.py b/apps/reminder/main_test.py similarity index 100% rename from apps/reminder/test_main.py rename to apps/reminder/main_test.py diff --git a/apps/shared/test_main.py b/apps/shared/main_test.py similarity index 100% rename from apps/shared/test_main.py rename to apps/shared/main_test.py diff --git a/apps/speak/test_main.py b/apps/speak/main_test.py similarity index 100% rename from apps/speak/test_main.py rename to apps/speak/main_test.py diff --git a/apps/startpage/test_main.py b/apps/startpage/main_test.py similarity index 100% rename from apps/startpage/test_main.py rename to apps/startpage/main_test.py diff --git a/apps/transform/test_main.py b/apps/transform/main_test.py similarity index 100% rename from apps/transform/test_main.py rename to apps/transform/main_test.py diff --git a/apps/visitors/test_main.py b/apps/visitors/main_test.py similarity index 100% rename from apps/visitors/test_main.py rename to apps/visitors/main_test.py diff --git a/apps/wakeup/test_main.py b/apps/wakeup/main_test.py similarity index 100% rename from apps/wakeup/test_main.py rename to apps/wakeup/main_test.py diff --git a/apps/weather/test_main.py b/apps/weather/main_test.py similarity index 100% rename from apps/weather/test_main.py rename to apps/weather/main_test.py diff --git a/apps/whois/test_main.py b/apps/whois/main_test.py similarity index 100% rename from apps/whois/test_main.py rename to apps/whois/main_test.py diff --git a/parsers/test_htmlhead.py b/parsers/htmlhead_test.py similarity index 100% rename from parsers/test_htmlhead.py rename to parsers/htmlhead_test.py diff --git a/parsers/test_htmltext.py b/parsers/htmltext_test.py similarity index 100% rename from parsers/test_htmltext.py rename to parsers/htmltext_test.py diff --git a/parsers/test_startpage.py b/parsers/startpage_test.py similarity index 100% rename from parsers/test_startpage.py rename to parsers/startpage_test.py diff --git a/plugins/test_markup.py b/plugins/markup_test.py similarity index 100% rename from plugins/test_markup.py rename to plugins/markup_test.py diff --git a/plugins/test_url.py b/plugins/url_test.py similarity index 100% rename from plugins/test_url.py rename to plugins/url_test.py