Commit e6cfad2f authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Context:

- removed unneeded files
- added control when no database engine can be instantiated
- added missing assertions in device and link unitary tests
parent 3cdbe036
Loading
Loading
Loading
Loading
−87

File deleted.

−33

File deleted.

+2
Changes for src/context/service/__main__.py: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -43,7 +43,9 @@ def main():
    metrics_port = get_metrics_port()
    start_http_server(metrics_port)

    # Get Database Engine instance and initialize database, if needed
    db_engine = Engine.get_engine()
    if db_engine is None: return -1
    Engine.create_database(db_engine)
    rebuild_database(db_engine)

+1
Changes for src/context/tests/test_device.py: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ def test_device(context_client : ContextClient) -> None:
    context_uuid = response.context_uuid.uuid

    response = context_client.SetTopology(Topology(**TOPOLOGY))
    assert response.context_id.context_uuid.uuid == context_uuid
    topology_uuid = response.topology_uuid.uuid

    events = events_collector.get_events(block=True, count=2, timeout=1.0)
+1
Changes for src/context/tests/test_link.py: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ def test_link(context_client : ContextClient) -> None:
    context_uuid = response.context_uuid.uuid

    response = context_client.SetTopology(Topology(**TOPOLOGY))
    assert response.context_id.context_uuid.uuid == context_uuid
    topology_uuid = response.topology_uuid.uuid

    response = context_client.SetDevice(Device(**DEVICE_R1))