Skip to content

Commit f0063be

Browse files
committed
Handle Zayo RESCHEDULE notifications.
1 parent 1638607 commit f0063be

File tree

8 files changed

+661
-0
lines changed

8 files changed

+661
-0
lines changed

circuit_maintenance_parser/parsers/zayo.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ def parse_html(self, soup):
5555
data["status"] = Status("IN-PROCESS")
5656
elif "has been completed" in text or "has closed" in text:
5757
data["status"] = Status("COMPLETED")
58+
elif "has rescheduled" in text:
59+
data["status"] = Status("RE-SCHEDULED")
5860

5961
return [data]
6062

tests/unit/data/zayo/zayo8.eml

Lines changed: 599 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[
2+
{
3+
"account": "Customer,inc",
4+
"circuits": [
5+
{
6+
"circuit_id": "/OQYX/234567/ /ZYO /",
7+
"impact": "OUTAGE"
8+
}
9+
],
10+
"end": 1641639600,
11+
"maintenance_id": "TTN-0001234567",
12+
"stamp": 1639526400,
13+
"start": 1641445260,
14+
"status": "RE-SCHEDULED",
15+
"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"
16+
}
17+
]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[
2+
{
3+
"account": "Customer,inc",
4+
"circuits": [
5+
{
6+
"circuit_id": "/OQYX/234567/ /ZYO /",
7+
"impact": "OUTAGE"
8+
}
9+
],
10+
"end": 1641639600,
11+
"maintenance_id": "TTN-0001234567",
12+
"organizer": "[email protected]",
13+
"provider": "zayo",
14+
"sequence": 1,
15+
"stamp": 1639526400,
16+
"start": 1641445260,
17+
"status": "RE-SCHEDULED",
18+
"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",
19+
"uid": "0"
20+
}
21+
]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[maint-notices] RESCHEDULE NOTIFICATION***Customer,inc***ZAYO TTN-0001234567 Planned***
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[
2+
{
3+
"account": "Customer,inc",
4+
"maintenance_id": "TTN-0001234567"
5+
}
6+
]

tests/unit/test_e2e.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,11 @@
486486
Zayo,
487487
[("email", Path(dir_path, "data", "zayo", "zayo7.eml")),],
488488
[Path(dir_path, "data", "zayo", "zayo7_result.json"),],
489+
),
490+
(
491+
Zayo,
492+
[("email", Path(dir_path, "data", "zayo", "zayo8.eml")),],
493+
[Path(dir_path, "data", "zayo", "zayo8_result.json"),],
489494
), # pylint: disable=too-many-locals
490495
],
491496
)

tests/unit/test_parsers.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,16 @@
382382
Path(dir_path, "data", "zayo", "zayo7.eml"),
383383
Path(dir_path, "data", "zayo", "zayo7_subject_parser_result.json"),
384384
),
385+
(
386+
HtmlParserZayo1,
387+
Path(dir_path, "data", "zayo", "zayo8.eml"),
388+
Path(dir_path, "data", "zayo", "zayo8_html_parser_result.json"),
389+
),
390+
(
391+
SubjectParserZayo1,
392+
Path(dir_path, "data", "zayo", "zayo8_subject.txt"),
393+
Path(dir_path, "data", "zayo", "zayo8_subject_parser_result.json"),
394+
),
385395
# Email Date
386396
(
387397
EmailDateParser,

0 commit comments

Comments
 (0)