def METHOD_NAME(tz, opening_hours, date, opens, closes=None):
    hours = opening_hours.get(date)
    assert hours is not None
    assert len(hours) == 1
    hours = hours[0]
    if opens:
        opens = tz.localize(datetime.datetime.combine(date, parser.parse(opens).time()))
        assert hours['opens'] == opens
    else:
        assert hours['opens'] is None
    if closes:
        closes = tz.localize(datetime.datetime.combine(date, parser.parse(closes).time()))
        assert hours['closes'] == closes
    else:
        assert hours['closes'] is None