This pull request includes significant updates to the calendar_parser.py file in the access_amherst_backend module, focusing on enhancing location handling and error management. Additionally, new tests have been added to the test_calendar_parser.py file to ensure the reliability of the new features.
This pull request includes significant updates to the
calendar_parser.py
file in theaccess_amherst_backend
module, focusing on enhancing location handling and error management. Additionally, new tests have been added to thetest_calendar_parser.py
file to ensure the reliability of the new features.Enhancements to location handling:
access_amherst_backend/access_amherst_algo/calendar_scraper/calendar_parser.py
: Introducedlocation_buckets
to categorize locations with full names, latitude, and longitude. Added functionscategorize_location
,get_lat_lng
, andadd_random_offset
to handle location data processing. [1] [2]Error management improvements:
access_amherst_backend/access_amherst_algo/calendar_scraper/calendar_parser.py
: Enhanced error handling infetch_page
andscrape_page
functions to manage unexpected exceptions gracefully. [1] [2]Testing enhancements:
access_amherst_backend/access_amherst_tests/test_calendar_parser.py
: Added parameterized tests forcategorize_location
andget_lat_lng
functions, a test foradd_random_offset
, and tests for exception handling inscrape_page
andfetch_page
.