From ad57996d659cdd9668efee8ba767623ae31af6d6 Mon Sep 17 00:00:00 2001 From: higs4281 Date: Wed, 18 Jan 2017 00:43:36 -0500 Subject: [PATCH] change extensions for saved logs from .html to .txt --- .../{changelog_2017.html => changelog_2017.txt} | 0 countylimits/data_collection/county_data_monitor.py | 6 +++--- .../{last_changelog.html => last_changelog.txt} | 0 .../management/commands/oah_check_county_changes.py | 2 +- countylimits/tests.py | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) rename countylimits/data_collection/{changelog_2017.html => changelog_2017.txt} (100%) rename countylimits/data_collection/{last_changelog.html => last_changelog.txt} (100%) diff --git a/countylimits/data_collection/changelog_2017.html b/countylimits/data_collection/changelog_2017.txt similarity index 100% rename from countylimits/data_collection/changelog_2017.html rename to countylimits/data_collection/changelog_2017.txt diff --git a/countylimits/data_collection/county_data_monitor.py b/countylimits/data_collection/county_data_monitor.py index 6d1272f..9d841f2 100644 --- a/countylimits/data_collection/county_data_monitor.py +++ b/countylimits/data_collection/county_data_monitor.py @@ -8,7 +8,7 @@ BASE_DIR = os.path.abspath(os.path.dirname(__file__)) CENSUS_CHANGELOG = 'https://www.census.gov/geo/reference/county-changes.html' -LAST_CHANGELOG = '{}/last_changelog.html'.format(BASE_DIR) +LAST_CHANGELOG = '{}/last_changelog.txt'.format(BASE_DIR) CHANGELOG_ID = 'tab_2010' @@ -37,7 +37,7 @@ def check_for_county_changes(email=None): """ Check the census county changelog against a local copy of the last log to see whether updates have been added. If changes are detected, - note the change and update our local 'last_changelog.html' file. + note the change and update our local 'last_changelog.txt' file. """ current_changelog = get_current_log() current_lines = get_lines(current_changelog) @@ -56,7 +56,7 @@ def check_for_county_changes(email=None): for diff in diffsett: msg += '\n{}'.format(diff) store_change_log(current_changelog) - msg += "\n\nOur 'last_changelog.html' file has been updated." + msg += "\n\nOur 'last_changelog.txt' file has been updated." if email: send_mail( 'Owning a Home alert: Change detected in census county data', diff --git a/countylimits/data_collection/last_changelog.html b/countylimits/data_collection/last_changelog.txt similarity index 100% rename from countylimits/data_collection/last_changelog.html rename to countylimits/data_collection/last_changelog.txt diff --git a/countylimits/management/commands/oah_check_county_changes.py b/countylimits/management/commands/oah_check_county_changes.py index cad5168..13909f7 100644 --- a/countylimits/management/commands/oah_check_county_changes.py +++ b/countylimits/management/commands/oah_check_county_changes.py @@ -5,7 +5,7 @@ COMMAND_HELP = "Check the census county changelog against a local copy " "of the last log to see whether updates have been added. " "If changes are detected, send an email alert about the change " -"and update our local 'last_changelog.html' file." +"and update our local 'last_changelog.txt' file." PARSER_HELP = "This command accepts a space-separated string " "of email recipients who will be notified if county changes are detected." diff --git a/countylimits/tests.py b/countylimits/tests.py index e8211bc..124d26e 100644 --- a/countylimits/tests.py +++ b/countylimits/tests.py @@ -84,7 +84,7 @@ def test_get_current_log(self, mock_bs, mock_requests): 'countylimits.data_collection.county_data_monitor.get_base_log') def test_county_data_monitor_no_change(self, mock_base, mock_current): with open("{}/countylimits/data_collection/" - "changelog_2017.html".format(BASE_PATH)) as f: + "changelog_2017.txt".format(BASE_PATH)) as f: mock_base.return_value = mock_current.return_value = f.read() self.assertIn( 'No county changes found', @@ -99,7 +99,7 @@ def test_county_data_monitor_no_change(self, mock_base, mock_current): def test_county_data_monitor_with_change_no_email( self, mock_store_log, mock_base, mock_current): with open("{}/countylimits/data_collection/" - "changelog_2017.html".format(BASE_PATH)) as f: + "changelog_2017.txt".format(BASE_PATH)) as f: mock_base.return_value = f.read() mock_current.return_value = ( mock_base.return_value + 'When dolphins fly.\n') @@ -121,7 +121,7 @@ def test_county_data_monitor_with_change_no_email( def test_county_data_monitor_with_change_and_email( self, mock_store_log, mock_mail, mock_base, mock_current): with open("{}/countylimits/data_collection/" - "changelog_2017.html".format(BASE_PATH)) as f: + "changelog_2017.txt".format(BASE_PATH)) as f: mock_base.return_value = f.read() mock_current.return_value = ( mock_base.return_value + 'When dolphins fly.\n')