diff --git a/circuit_maintenance_parser/parsers/zayo.py b/circuit_maintenance_parser/parsers/zayo.py index 4d92fc74..a6fb9c3d 100644 --- a/circuit_maintenance_parser/parsers/zayo.py +++ b/circuit_maintenance_parser/parsers/zayo.py @@ -1,6 +1,7 @@ """Zayo parser.""" import logging import re +from copy import deepcopy from typing import Dict import bs4 # type: ignore @@ -44,21 +45,30 @@ class HtmlParserZayo1(Html): def parse_html(self, soup): """Execute parsing.""" + maintenances = [] data = {} self.parse_bs(soup.find_all("b"), data) self.parse_tables(soup.find_all("table"), data) - if data: - if "status" not in data: - text = soup.get_text() - if "will be commencing momentarily" in text: - data["status"] = Status("IN-PROCESS") - elif "has been completed" in text or "has closed" in text: - data["status"] = Status("COMPLETED") - elif "has rescheduled" in text: - data["status"] = Status("RE-SCHEDULED") + if not data: + return [{}] - return [data] + if "status" not in data: + text = soup.get_text() + if "will be commencing momentarily" in text: + data["status"] = Status("IN-PROCESS") + elif "has been completed" in text or "has closed" in text: + data["status"] = Status("COMPLETED") + elif "has rescheduled" in text: + data["status"] = Status("RE-SCHEDULED") + + for maintenance_window in data.get("windows", []): + maintenance = deepcopy(data) + maintenance["start"], maintenance["end"] = maintenance_window + del maintenance["windows"] + maintenances.append(maintenance) + + return maintenances def parse_bs(self, btags: ResultSet, data: dict): """Parse B tag.""" @@ -71,41 +81,23 @@ def parse_bs(self, btags: ResultSet, data: dict): data["status"] = Status("CONFIRMED") elif "has cancelled" in line.text.lower(): data["status"] = Status("CANCELLED") - # Some Zayo notifications may include multiple activity dates. - # For lack of a better way to handle this, we consolidate these into a single extended activity range. - # - # For example, given: - # - # 1st Activity Date - # 01-Nov-2021 00:01 to 01-Nov-2021 05:00 ( Mountain ) - # 01-Nov-2021 06:01 to 01-Nov-2021 11:00 ( GMT ) - # - # 2nd Activity Date - # 02-Nov-2021 00:01 to 02-Nov-2021 05:00 ( Mountain ) - # 02-Nov-2021 06:01 to 02-Nov-2021 11:00 ( GMT ) - # - # 3rd Activity Date - # 03-Nov-2021 00:01 to 03-Nov-2021 05:00 ( Mountain ) - # 03-Nov-2021 06:01 to 03-Nov-2021 11:00 ( GMT ) - # - # our end result would be (start: "01-Nov-2021 06:01", end: "03-Nov-2021 11:00") elif "activity date" in line.text.lower(): logger.info("Found 'activity date': %s", line.text) + + if "windows" not in data: + data["windows"] = [] + for sibling in line.next_siblings: text = sibling.text if isinstance(sibling, bs4.element.Tag) else sibling logger.debug("Checking for GMT date/timestamp in sibling: %s", text) + if "( GMT )" in text: window = self.clean_line(sibling).strip("( GMT )").split(" to ") start = parser.parse(window.pop(0)) - start_ts = self.dt2ts(start) - # Keep the earliest of any listed start times - if "start" not in data or data["start"] > start_ts: - data["start"] = start_ts end = parser.parse(window.pop(0)) + start_ts = self.dt2ts(start) end_ts = self.dt2ts(end) - # Keep the latest of any listed end times - if "end" not in data or data["end"] < end_ts: - data["end"] = end_ts + data["windows"].append((start_ts, end_ts)) break elif line.text.lower().strip().startswith("reason for maintenance:"): data["summary"] = self.clean_line(line.next_sibling) @@ -148,6 +140,7 @@ def parse_tables(self, tables: ResultSet, data: Dict): "Customer Circuit ID", ], ) + if all(table_headers != expected_headers for expected_headers in expected_headers_ref): logger.warning("Table headers are not as expected: %s", head_row) continue @@ -155,6 +148,7 @@ def parse_tables(self, tables: ResultSet, data: Dict): data_rows = table.find_all("td") if len(data_rows) % 5 != 0: raise AssertionError("Table format is not correct") + number_of_circuits = int(len(data_rows) / 5) for idx in range(number_of_circuits): data_circuit = {} @@ -165,5 +159,6 @@ def parse_tables(self, tables: ResultSet, data: Dict): elif "no expected impact" in impact.lower(): data_circuit["impact"] = Impact("NO-IMPACT") circuits.append(CircuitImpact(**data_circuit)) + if circuits: data["circuits"] = circuits diff --git a/tests/unit/data/zayo/zayo5_html_parser_result.json b/tests/unit/data/zayo/zayo5_html_parser_result.json index 6aaf9397..cc13df9e 100644 --- a/tests/unit/data/zayo/zayo5_html_parser_result.json +++ b/tests/unit/data/zayo/zayo5_html_parser_result.json @@ -1,5 +1,7 @@ [ { + "maintenance_id": "TTN-0003456789", + "summary": "Routine Fiber splice - NO Impact is Expected to your services. This notification is to advise you that we will be entering a splice case that houses live traffic.", "circuits": [ { "circuit_id": "/OGYX/123456/ /ZYO /", @@ -10,10 +12,42 @@ "impact": "NO-IMPACT" } ], - "end": 1635937200, - "maintenance_id": "TTN-0003456789", + "status": "IN-PROCESS", "start": 1635746460, + "end": 1635764400 + }, + { + "maintenance_id": "TTN-0003456789", + "summary": "Routine Fiber splice - NO Impact is Expected to your services. This notification is to advise you that we will be entering a splice case that houses live traffic.", + "circuits": [ + { + "circuit_id": "/OGYX/123456/ /ZYO /", + "impact": "NO-IMPACT" + }, + { + "circuit_id": "/OGYX/234567/ /ZYO /", + "impact": "NO-IMPACT" + } + ], + "status": "IN-PROCESS", + "start": 1635832860, + "end": 1635850800 + }, + { + "maintenance_id": "TTN-0003456789", + "summary": "Routine Fiber splice - NO Impact is Expected to your services. This notification is to advise you that we will be entering a splice case that houses live traffic.", + "circuits": [ + { + "circuit_id": "/OGYX/123456/ /ZYO /", + "impact": "NO-IMPACT" + }, + { + "circuit_id": "/OGYX/234567/ /ZYO /", + "impact": "NO-IMPACT" + } + ], "status": "IN-PROCESS", - "summary": "Routine Fiber splice - NO Impact is Expected to your services. This notification is to advise you that we will be entering a splice case that houses live traffic." + "start": 1635919260, + "end": 1635937200 } ] diff --git a/tests/unit/data/zayo/zayo5_result.json b/tests/unit/data/zayo/zayo5_result.json index 34feb2ef..1da93a71 100644 --- a/tests/unit/data/zayo/zayo5_result.json +++ b/tests/unit/data/zayo/zayo5_result.json @@ -11,11 +11,49 @@ "impact": "NO-IMPACT" } ], - "end": 1635937200, + "end": 1635764400, "maintenance_id": "TTN-0003456789", "stamp": 1635918838, + "status": "IN-PROCESS", "start": 1635746460, + "summary": "Routine Fiber splice - NO Impact is Expected to your services. This notification is to advise you that we will be entering a splice case that houses live traffic." + }, + { + "account": "Some Customer Inc", + "circuits": [ + { + "circuit_id": "/OGYX/123456/ /ZYO /", + "impact": "NO-IMPACT" + }, + { + "circuit_id": "/OGYX/234567/ /ZYO /", + "impact": "NO-IMPACT" + } + ], + "end": 1635850800, + "maintenance_id": "TTN-0003456789", + "stamp": 1635918838, + "status": "IN-PROCESS", + "start": 1635832860, + "summary": "Routine Fiber splice - NO Impact is Expected to your services. This notification is to advise you that we will be entering a splice case that houses live traffic." + }, + { + "account": "Some Customer Inc", + "circuits": [ + { + "circuit_id": "/OGYX/123456/ /ZYO /", + "impact": "NO-IMPACT" + }, + { + "circuit_id": "/OGYX/234567/ /ZYO /", + "impact": "NO-IMPACT" + } + ], + "end": 1635937200, + "maintenance_id": "TTN-0003456789", + "stamp": 1635918838, "status": "IN-PROCESS", + "start": 1635919260, "summary": "Routine Fiber splice - NO Impact is Expected to your services. This notification is to advise you that we will be entering a splice case that houses live traffic." } ] diff --git a/tests/unit/data/zayo/zayo6_html_parser_result.json b/tests/unit/data/zayo/zayo6_html_parser_result.json index 6fc7f11c..98c8e8aa 100644 --- a/tests/unit/data/zayo/zayo6_html_parser_result.json +++ b/tests/unit/data/zayo/zayo6_html_parser_result.json @@ -1,19 +1,53 @@ [ { + "maintenance_id": "TTN-0004567890", + "summary": "Routine Fiber splice - NO Impact is Expected to your services. This notification is to advise you that we will be entering a splice case that houses live traffic.", "circuits": [ { "circuit_id": "/OGYX/123418/ /ZYO /", "impact": "NO-IMPACT" }, { - "circuit_id": "/OGYX/123408/ /ZYO /", + "circuit_id":"/OGYX/123408/ /ZYO /", "impact": "NO-IMPACT" } ], - "end": 1635937200, - "maintenance_id": "TTN-0004567890", + "status": "COMPLETED", "start": 1635746460, + "end": 1635764400 + }, + { + "maintenance_id": "TTN-0004567890", + "summary": "Routine Fiber splice - NO Impact is Expected to your services. This notification is to advise you that we will be entering a splice case that houses live traffic.", + "circuits": [ + { + "circuit_id": "/OGYX/123418/ /ZYO /", + "impact": "NO-IMPACT" + }, + { + "circuit_id":"/OGYX/123408/ /ZYO /", + "impact": "NO-IMPACT" + } + ], + "status": "COMPLETED", + "start": 1635832860, + "end": 1635850800 + }, + { + "maintenance_id": "TTN-0004567890", + "summary": "Routine Fiber splice - NO Impact is Expected to your services. This notification is to advise you that we will be entering a splice case that houses live traffic.", + "circuits": [ + { + "circuit_id": "/OGYX/123418/ /ZYO /", + "impact": "NO-IMPACT" + }, + { + "circuit_id":"/OGYX/123408/ /ZYO /", + "impact": "NO-IMPACT" + } + ], "status": "COMPLETED", - "summary": "Routine Fiber splice - NO Impact is Expected to your services. This notification is to advise you that we will be entering a splice case that houses live traffic." + "start": 1635919260, + "end": 1635937200 } -] +] \ No newline at end of file diff --git a/tests/unit/data/zayo/zayo6_result.json b/tests/unit/data/zayo/zayo6_result.json index 372d9776..cec054f1 100644 --- a/tests/unit/data/zayo/zayo6_result.json +++ b/tests/unit/data/zayo/zayo6_result.json @@ -7,15 +7,53 @@ "impact": "NO-IMPACT" }, { - "circuit_id": "/OGYX/123408/ /ZYO /", + "circuit_id":"/OGYX/123408/ /ZYO /", "impact": "NO-IMPACT" } ], - "end": 1635937200, + "end": 1635764400, "maintenance_id": "TTN-0004567890", "stamp": 1635936668, + "status": "COMPLETED", "start": 1635746460, + "summary": "Routine Fiber splice - NO Impact is Expected to your services. This notification is to advise you that we will be entering a splice case that houses live traffic." + }, + { + "account": "Some Customer Inc", + "circuits": [ + { + "circuit_id": "/OGYX/123418/ /ZYO /", + "impact": "NO-IMPACT" + }, + { + "circuit_id":"/OGYX/123408/ /ZYO /", + "impact": "NO-IMPACT" + } + ], + "end": 1635850800, + "maintenance_id": "TTN-0004567890", + "stamp": 1635936668, + "status": "COMPLETED", + "start": 1635832860, + "summary": "Routine Fiber splice - NO Impact is Expected to your services. This notification is to advise you that we will be entering a splice case that houses live traffic." + }, + { + "account": "Some Customer Inc", + "circuits": [ + { + "circuit_id": "/OGYX/123418/ /ZYO /", + "impact": "NO-IMPACT" + }, + { + "circuit_id":"/OGYX/123408/ /ZYO /", + "impact": "NO-IMPACT" + } + ], + "end": 1635937200, + "maintenance_id": "TTN-0004567890", + "stamp": 1635936668, "status": "COMPLETED", + "start": 1635919260, "summary": "Routine Fiber splice - NO Impact is Expected to your services. This notification is to advise you that we will be entering a splice case that houses live traffic." } -] +] \ No newline at end of file diff --git a/tests/unit/data/zayo/zayo7_html_parser_result.json b/tests/unit/data/zayo/zayo7_html_parser_result.json index 5d185420..5b9703b8 100644 --- a/tests/unit/data/zayo/zayo7_html_parser_result.json +++ b/tests/unit/data/zayo/zayo7_html_parser_result.json @@ -6,10 +6,36 @@ "impact": "OUTAGE" } ], - "end": 1637067600, + "end": 1636894800, "maintenance_id": "TTN-0005432100", "start": 1636876860, "status": "COMPLETED", "summary": "Zayo will implement maintenance to repair damaged fiber splice case, to prevent unplanned outages" + }, + { + "circuits": [ + { + "circuit_id": "/IPYX/100722/ /ZYO /", + "impact": "OUTAGE" + } + ], + "end": 1636981200, + "maintenance_id": "TTN-0005432100", + "start": 1636963260, + "status": "COMPLETED", + "summary": "Zayo will implement maintenance to repair damaged fiber splice case, to prevent unplanned outages" + }, + { + "circuits": [ + { + "circuit_id": "/IPYX/100722/ /ZYO /", + "impact": "OUTAGE" + } + ], + "end": 1637067600, + "maintenance_id": "TTN-0005432100", + "start": 1637049660, + "status": "COMPLETED", + "summary": "Zayo will implement maintenance to repair damaged fiber splice case, to prevent unplanned outages" } -] +] \ No newline at end of file diff --git a/tests/unit/data/zayo/zayo7_result.json b/tests/unit/data/zayo/zayo7_result.json index ba5a64ec..fdfc29b7 100644 --- a/tests/unit/data/zayo/zayo7_result.json +++ b/tests/unit/data/zayo/zayo7_result.json @@ -7,11 +7,41 @@ "impact": "OUTAGE" } ], - "end": 1637067600, + "end": 1636894800, "maintenance_id": "TTN-0005432100", "stamp": 1637068032, "start": 1636876860, "status": "COMPLETED", "summary": "Zayo will implement maintenance to repair damaged fiber splice case, to prevent unplanned outages" + }, + { + "account": "Example Inc.", + "circuits": [ + { + "circuit_id": "/IPYX/100722/ /ZYO /", + "impact": "OUTAGE" + } + ], + "end": 1636981200, + "maintenance_id": "TTN-0005432100", + "stamp": 1637068032, + "start": 1636963260, + "status": "COMPLETED", + "summary": "Zayo will implement maintenance to repair damaged fiber splice case, to prevent unplanned outages" + }, + { + "account": "Example Inc.", + "circuits": [ + { + "circuit_id": "/IPYX/100722/ /ZYO /", + "impact": "OUTAGE" + } + ], + "end": 1637067600, + "maintenance_id": "TTN-0005432100", + "stamp": 1637068032, + "start": 1637049660, + "status": "COMPLETED", + "summary": "Zayo will implement maintenance to repair damaged fiber splice case, to prevent unplanned outages" } -] +] \ No newline at end of file diff --git a/tests/unit/data/zayo/zayo8_html_parser_result.json b/tests/unit/data/zayo/zayo8_html_parser_result.json index fa92f9e3..d9b63621 100644 --- a/tests/unit/data/zayo/zayo8_html_parser_result.json +++ b/tests/unit/data/zayo/zayo8_html_parser_result.json @@ -7,11 +7,41 @@ "impact": "OUTAGE" } ], - "end": 1641639600, + "end": 1641466800, "maintenance_id": "TTN-0001234567", "stamp": 1639526400, "start": 1641445260, "status": "RE-SCHEDULED", "summary": "Zayo Third-Party Provider will implement maintenance to perform temporary fiber relocation in order to proactively avoid outages.\"Please Note\" This is a reschedule of TTN-0002345678\nAs this maintenance is not under the control of Zayo it may not be possible to reschedule it, due to resources having been coordinated with the railway system (Lat: 50.12345- Lon: -119.12345)The maintenance consists of 2 nights; however, customers will only receive notification for the night their services will be impacted" + }, + { + "account": "Customer,inc", + "circuits": [ + { + "circuit_id": "/OQYX/234567/ /ZYO /", + "impact": "OUTAGE" + } + ], + "end": 1641553200, + "maintenance_id": "TTN-0001234567", + "stamp": 1639526400, + "start": 1641531660, + "status": "RE-SCHEDULED", + "summary": "Zayo Third-Party Provider will implement maintenance to perform temporary fiber relocation in order to proactively avoid outages.\"Please Note\" This is a reschedule of TTN-0002345678\nAs this maintenance is not under the control of Zayo it may not be possible to reschedule it, due to resources having been coordinated with the railway system (Lat: 50.12345- Lon: -119.12345)The maintenance consists of 2 nights; however, customers will only receive notification for the night their services will be impacted" + }, + { + "account": "Customer,inc", + "circuits": [ + { + "circuit_id": "/OQYX/234567/ /ZYO /", + "impact": "OUTAGE" + } + ], + "end": 1641639600, + "maintenance_id": "TTN-0001234567", + "stamp": 1639526400, + "start": 1641618060, + "status": "RE-SCHEDULED", + "summary": "Zayo Third-Party Provider will implement maintenance to perform temporary fiber relocation in order to proactively avoid outages.\"Please Note\" This is a reschedule of TTN-0002345678\nAs this maintenance is not under the control of Zayo it may not be possible to reschedule it, due to resources having been coordinated with the railway system (Lat: 50.12345- Lon: -119.12345)The maintenance consists of 2 nights; however, customers will only receive notification for the night their services will be impacted" } ] diff --git a/tests/unit/data/zayo/zayo8_result.json b/tests/unit/data/zayo/zayo8_result.json index bef1ac48..e69c24e8 100644 --- a/tests/unit/data/zayo/zayo8_result.json +++ b/tests/unit/data/zayo/zayo8_result.json @@ -3,11 +3,11 @@ "account": "Customer,inc", "circuits": [ { - "circuit_id": "/OQYX/234567/ /ZYO /", - "impact": "OUTAGE" + "circuit_id": "/OQYX/234567/ /ZYO /", + "impact": "OUTAGE" } ], - "end": 1641639600, + "end": 1641466800, "maintenance_id": "TTN-0001234567", "organizer": "mr@zayo.com", "provider": "zayo", @@ -17,5 +17,43 @@ "status": "RE-SCHEDULED", "summary": "Zayo Third-Party Provider will implement maintenance to perform temporary fiber relocation in order to proactively avoid outages.\"Please Note\" This is a reschedule of TTN-0002345678\nAs this maintenance is not under the control of Zayo it may not be possible to reschedule it, due to resources having been coordinated with the railway system (Lat: 50.12345- Lon: -119.12345)The maintenance consists of 2 nights; however, customers will only receive notification for the night their services will be impacted", "uid": "0" + }, + { + "account": "Customer,inc", + "circuits": [ + { + "circuit_id": "/OQYX/234567/ /ZYO /", + "impact": "OUTAGE" + } + ], + "end": 1641553200, + "maintenance_id": "TTN-0001234567", + "organizer": "mr@zayo.com", + "provider": "zayo", + "sequence": 1, + "stamp": 1639526400, + "start": 1641531660, + "status": "RE-SCHEDULED", + "summary": "Zayo Third-Party Provider will implement maintenance to perform temporary fiber relocation in order to proactively avoid outages.\"Please Note\" This is a reschedule of TTN-0002345678\nAs this maintenance is not under the control of Zayo it may not be possible to reschedule it, due to resources having been coordinated with the railway system (Lat: 50.12345- Lon: -119.12345)The maintenance consists of 2 nights; however, customers will only receive notification for the night their services will be impacted", + "uid": "0" + }, + { + "account": "Customer,inc", + "circuits": [ + { + "circuit_id": "/OQYX/234567/ /ZYO /", + "impact": "OUTAGE" + } + ], + "end": 1641639600, + "maintenance_id": "TTN-0001234567", + "organizer": "mr@zayo.com", + "provider": "zayo", + "sequence": 1, + "stamp": 1639526400, + "start": 1641618060, + "status": "RE-SCHEDULED", + "summary": "Zayo Third-Party Provider will implement maintenance to perform temporary fiber relocation in order to proactively avoid outages.\"Please Note\" This is a reschedule of TTN-0002345678\nAs this maintenance is not under the control of Zayo it may not be possible to reschedule it, due to resources having been coordinated with the railway system (Lat: 50.12345- Lon: -119.12345)The maintenance consists of 2 nights; however, customers will only receive notification for the night their services will be impacted", + "uid": "0" } -] +] \ No newline at end of file diff --git a/tests/unit/data/zayo/zayo9_html_parser_result.json b/tests/unit/data/zayo/zayo9_html_parser_result.json index ae36bebd..00253880 100644 --- a/tests/unit/data/zayo/zayo9_html_parser_result.json +++ b/tests/unit/data/zayo/zayo9_html_parser_result.json @@ -7,11 +7,41 @@ "impact": "OUTAGE" } ], - "end": 1641639600, + "end": 1641466800, "maintenance_id": "TTN-0001234567", "stamp": 1639526400, "start": 1641445260, "status": "RE-SCHEDULED", "summary": "Zayo Third-Party Provider will implement maintenance to perform temporary fiber relocation in order to proactively avoid outages.\"Please Note\" This is a reschedule of TTN-0002345678\r\nAs this maintenance is not under the control of Zayo it may not be possible to reschedule it, due to resources having been coordinated with the railway system (Lat: 50.12345- Lon: -119.12345)The maintenance consists of 2 nights; however, customers will only receive notification for the night their services will be impacted" + }, + { + "account": "Customer,inc", + "circuits": [ + { + "circuit_id": "/OQYX/234567/ /ZYO /", + "impact": "OUTAGE" + } + ], + "end": 1641553200, + "maintenance_id": "TTN-0001234567", + "stamp": 1639526400, + "start": 1641531660, + "status": "RE-SCHEDULED", + "summary": "Zayo Third-Party Provider will implement maintenance to perform temporary fiber relocation in order to proactively avoid outages.\"Please Note\" This is a reschedule of TTN-0002345678\r\nAs this maintenance is not under the control of Zayo it may not be possible to reschedule it, due to resources having been coordinated with the railway system (Lat: 50.12345- Lon: -119.12345)The maintenance consists of 2 nights; however, customers will only receive notification for the night their services will be impacted" + }, + { + "account": "Customer,inc", + "circuits": [ + { + "circuit_id": "/OQYX/234567/ /ZYO /", + "impact": "OUTAGE" + } + ], + "end": 1641639600, + "maintenance_id": "TTN-0001234567", + "stamp": 1639526400, + "start": 1641618060, + "status": "RE-SCHEDULED", + "summary": "Zayo Third-Party Provider will implement maintenance to perform temporary fiber relocation in order to proactively avoid outages.\"Please Note\" This is a reschedule of TTN-0002345678\r\nAs this maintenance is not under the control of Zayo it may not be possible to reschedule it, due to resources having been coordinated with the railway system (Lat: 50.12345- Lon: -119.12345)The maintenance consists of 2 nights; however, customers will only receive notification for the night their services will be impacted" } -] +] \ No newline at end of file diff --git a/tests/unit/data/zayo/zayo9_result.json b/tests/unit/data/zayo/zayo9_result.json index cec6ed48..ecfccd56 100644 --- a/tests/unit/data/zayo/zayo9_result.json +++ b/tests/unit/data/zayo/zayo9_result.json @@ -7,7 +7,7 @@ "impact": "OUTAGE" } ], - "end": 1641639600, + "end": 1641466800, "maintenance_id": "TTN-0001234567", "organizer": "mr@zayo.com", "provider": "zayo", @@ -17,5 +17,43 @@ "status": "RE-SCHEDULED", "summary": "Zayo Third-Party Provider will implement maintenance to perform temporary fiber relocation in order to proactively avoid outages.\"Please Note\" This is a reschedule of TTN-0002345678\r\nAs this maintenance is not under the control of Zayo it may not be possible to reschedule it, due to resources having been coordinated with the railway system (Lat: 50.12345- Lon: -119.12345)The maintenance consists of 2 nights; however, customers will only receive notification for the night their services will be impacted", "uid": "0" + }, + { + "account": "Customer,inc", + "circuits": [ + { + "circuit_id": "/OQYX/234567/ /ZYO /", + "impact": "OUTAGE" + } + ], + "end": 1641553200, + "maintenance_id": "TTN-0001234567", + "organizer": "mr@zayo.com", + "provider": "zayo", + "sequence": 1, + "stamp": 1639526400, + "start": 1641531660, + "status": "RE-SCHEDULED", + "summary": "Zayo Third-Party Provider will implement maintenance to perform temporary fiber relocation in order to proactively avoid outages.\"Please Note\" This is a reschedule of TTN-0002345678\r\nAs this maintenance is not under the control of Zayo it may not be possible to reschedule it, due to resources having been coordinated with the railway system (Lat: 50.12345- Lon: -119.12345)The maintenance consists of 2 nights; however, customers will only receive notification for the night their services will be impacted", + "uid": "0" + }, + { + "account": "Customer,inc", + "circuits": [ + { + "circuit_id": "/OQYX/234567/ /ZYO /", + "impact": "OUTAGE" + } + ], + "end": 1641639600, + "maintenance_id": "TTN-0001234567", + "organizer": "mr@zayo.com", + "provider": "zayo", + "sequence": 1, + "stamp": 1639526400, + "start": 1641618060, + "status": "RE-SCHEDULED", + "summary": "Zayo Third-Party Provider will implement maintenance to perform temporary fiber relocation in order to proactively avoid outages.\"Please Note\" This is a reschedule of TTN-0002345678\r\nAs this maintenance is not under the control of Zayo it may not be possible to reschedule it, due to resources having been coordinated with the railway system (Lat: 50.12345- Lon: -119.12345)The maintenance consists of 2 nights; however, customers will only receive notification for the night their services will be impacted", + "uid": "0" } -] +] \ No newline at end of file diff --git a/tests/unit/test_parsers.py b/tests/unit/test_parsers.py index 1117a773..1be4978b 100644 --- a/tests/unit/test_parsers.py +++ b/tests/unit/test_parsers.py @@ -547,7 +547,7 @@ def test_parsers(parser_class, raw_file, results_file): assert parsed_notifications == expected_result -@pytest.mark.parametrize("parser_class", [ICal, EmailDateParser, HtmlParserZayo1, SubjectParserSeaborn1]) +@pytest.mark.parametrize("parser_class", [ICal, EmailDateParser, HtmlParserZayo1, SubjectParserZayo1]) def test_parser_no_data(parser_class): """Test parser with no data.""" with pytest.raises(ParserError):