tests: add a test for opening hours on first january (#50419)

This commit is contained in:
Nicolas Roche 2021-01-21 18:29:35 +01:00
parent c0d31ce0c7
commit 59632e6b30
1 changed files with 28 additions and 0 deletions

View File

@ -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'})
]