You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+57Lines changed: 57 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -312,6 +312,63 @@ The project is following Network to Code software development guidelines and is
312
312
- The `Provider` also supports the definition of a `_include_filter` and a `_exclude_filter` to limit the notifications that are actually processed, avoiding false positive errors for notification that are not relevant.
313
313
4. Update the `unit/test_e2e.py` with the new provider, providing some data to test and validate the final `Maintenances` created.
314
314
5.**Expose the new `Provider` class** updating the map `SUPPORTED_PROVIDERS` in `circuit_maintenance_parser/__init__.py` to officially expose the `Provider`.
315
+
6. You can run some tests here to verify that your new unit tests do not cause issues with existing tests, and in general they work as expected. You can do this by running `pytest --log-cli-level=DEBUG --capture=tee-sys`. You can narrow down the tests that you want to execute with the `-k` flag. If successful, your results should look similar to the following:
====================================================== 99 passed, 174 deselected, 17 warnings in 10.35s ======================================================
321
+
```
322
+
7. Run some final CI tests locally to ensure that there is no linting/formatting issues with your changes. You should look to get a code score of 10/10. See the example below: `invoke tests --local`
Provider processing failed: Failed creating Maintenance notification for Zayo.
357
+
Details:
358
+
- Processor CombinedProcessor from Zayo failed due to: Debugging exception
359
+
```
360
+
361
+
> Note: `invoke build` will result in an error due to no Dockerfile. This is expected as the library runs simple pytest testing without a container.
362
+
363
+
```
364
+
-> % invoke build
365
+
Building image circuit-maintenance-parser:2.2.2-py3.8
366
+
#1 [internal] load build definition from Dockerfile
367
+
#1 transferring dockerfile: 2B done
368
+
#1 DONE 0.0s
369
+
WARNING: failed to get git remote url: fatal: No remote configured to list refs from.
370
+
ERROR: failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount1243547759/Dockerfile: no such file or directory
Copy file name to clipboardExpand all lines: circuit_maintenance_parser/parsers/lumen.py
+21-4Lines changed: 21 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,7 @@
2
2
importlogging
3
3
fromtypingimportDict
4
4
5
+
fromcopyimportdeepcopy
5
6
fromdateutilimportparser
6
7
importbs4# type: ignore
7
8
frombs4.elementimportResultSet# type: ignore
@@ -19,10 +20,22 @@ class HtmlParserLumen1(Html):
19
20
20
21
defparse_html(self, soup):
21
22
"""Execute parsing."""
23
+
maintenances= []
22
24
data= {}
23
25
self.parse_spans(soup.find_all("span"), data)
24
26
self.parse_tables(soup.find_all("table"), data)
25
-
return [data]
27
+
28
+
# Iterates over multiple windows and duplicates other maintenance info to a new dictionary while also updating start and end times for the specific window.
29
+
forwindowindata["windows"]:
30
+
maintenance=deepcopy(data)
31
+
maintenance["start"], maintenance["end"] =window
32
+
delmaintenance["windows"]
33
+
maintenances.append(maintenance)
34
+
35
+
# Deleting the key after we are finished checking for multiple windows and duplicating data.
0 commit comments