diff --git a/tests/test_get_mairie_opening_hours.py b/tests/test_get_mairie_opening_hours.py index b15af2c..adfb0bf 100644 --- a/tests/test_get_mairie_opening_hours.py +++ b/tests/test_get_mairie_opening_hours.py @@ -250,3 +250,31 @@ def test_mairie_saint_genis_lavak(): ('vendredi', {'am': '08h30-12h00', 'pm': '13h30-17h30'}), ('samedi', {'am': '09h00-12h00', 'pm': None}) ] + + +@pytest.mark.freeze_time("2018-01-01 14:59:00") +def test_mairie_holiday(): + # Ecully, using datetimes + test_time_table = [ + get_mairie_opening_hours(x) for x in GEOJSON if x['properties']['identifiant'] == 'S1361' + ][0] + assert test_time_table == [ + ('lundi', {'am': '08h30-12h00', 'pm': '13h30-17h00'}), # but closed on 1/1 + ('mardi', {'am': '08h30-12h00', 'pm': '13h30-17h00'}), + ('mercredi', {'am': '08h30-12h00', 'pm': '13h30-17h00'}), + ('jeudi', {'am': '08h30-12h00', 'pm': '13h30-17h00'}), + ('vendredi', {'am': '08h30-12h00', 'pm': '13h30-17h00'}), + ('samedi', {'am': '08h30-12h00', 'pm': None}) + ] + + # Feyzin, using dates + test_time_table = [ + get_mairie_opening_hours(x) for x in GEOJSON if x['properties']['identifiant'] == 'S1365' + ][0] + assert test_time_table == [ + ('lundi', {'am': '08h30-12h00', 'pm': '13h30-17h30'}), # but closed on 1/1 + ('mardi', {'am': '08h30-12h00', 'pm': '13h30-17h30'}), + ('mercredi', {'am': '08h30-12h00', 'pm': '13h30-17h30'}), + ('jeudi', {'am': '08h30-12h00', 'pm': '13h30-17h30'}), + ('vendredi', {'am': '08h30-12h00', 'pm': '13h30-17h30'}) + ]