Skip to content

Commit

Permalink
change extensions for saved logs from .html to .txt
Browse files Browse the repository at this point in the history
  • Loading branch information
higs4281 committed Jan 18, 2017
1 parent 75b6412 commit ad57996
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions countylimits/data_collection/county_data_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'


Expand Down Expand Up @@ -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)
Expand All @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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."

Expand Down
6 changes: 3 additions & 3 deletions countylimits/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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')
Expand All @@ -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')
Expand Down

0 comments on commit ad57996

Please sign in to comment.