-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add dump functionality from records ingress handler * add cli subcommand for scanning bacnet network * add bacnet cli test * add load methods and tests * make bacnet cli test end to end * point assert to correct path * add doc strings * BACnet ingress free socket after discover * expose ports in docker compose * run bacnet tests within a docker container on the same virtual network as the virtual bacnet device * fix indentation * cleanup tests * replace assert with warning * fix test issues
- Loading branch information
1 parent
82413c6
commit d5bd920
Showing
9 changed files
with
157 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[pytest] | ||
addopts = | ||
-m "not bacnet" | ||
markers = | ||
integration: marks tests as integration tests (deselect with '-m "not integration"') | ||
bacnet: marks tests to be run with a virtual bacnet network (deselected by default) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM python:3.8 | ||
|
||
WORKDIR /home/buildingmotif | ||
|
||
RUN pip install poetry==1.4.0 && poetry config virtualenvs.create false | ||
|
||
COPY pyproject.toml . | ||
COPY poetry.lock . | ||
|
||
RUN poetry install --no-root | ||
|
||
COPY buildingmotif buildingmotif | ||
COPY tests tests | ||
COPY notebooks notebooks | ||
COPY migrations migrations | ||
COPY docs docs | ||
|
||
RUN poetry install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from pathlib import Path | ||
|
||
from buildingmotif.ingresses.base import Record, RecordIngressHandler | ||
|
||
|
||
def test_ingress_dump_load(bm, tmp_path: Path): | ||
records = [ | ||
Record("a", {"a": 1, "b": 2}), | ||
Record("b", {"b": 1, "a": 2}), | ||
] | ||
|
||
output_file = tmp_path / "output.json" | ||
|
||
ingress_handler_1 = RecordIngressHandler.__new__(RecordIngressHandler) | ||
ingress_handler_1.records = records | ||
ingress_handler_1.dump(output_file) | ||
|
||
ingress_handler_2 = RecordIngressHandler.load(output_file) | ||
ingress_records = ingress_handler_2.records | ||
|
||
assert ingress_records == records |