def __init__(self, value): """ @param value to parse """ self.value = clean_value(value) self.is_always_open = False if self.value == "24/7": self.is_always_open = True return # can't parse this value atm try: self.opening_hours = parse_string(self.value) except Exception as e: raise ParseException(value, e)
def test_clean_value(self): self.assertEqual(clean_value("Mo-Fr 08:30-22:00; "), "mo-fr 08:30-22:00")