Skip to content

Commit

Permalink
Fixed tests after changes related to node parameters, removed mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
tmikuska committed Oct 24, 2023
1 parent 83d0e2b commit 8c217d0
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 13 deletions.
10 changes: 0 additions & 10 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@

import httpx
import pytest
import json
import os

from virl2_client.virl2_client import ClientLibrary

Expand Down Expand Up @@ -123,14 +121,6 @@ def respx_mock_with_labs(respx_mock):
).respond(
json={"operational": {"compute_id": "99c887f5-052e-4864-a583-49fa7c4b68a9"}}
)

populate_lab_tiles = open(os.path.join(os.path.dirname(__file__), "test_data","populate_lab_tiles.json"))
labs = json.load(populate_lab_tiles)["lab_tiles"]

for lab_id, lab in labs.items():
for node in lab["topology"]["nodes"]:
respx_mock.get(FAKE_HOST_API + f"labs/{lab_id}/nodes/{node['id']}").respond(json={})

resp_from_files = (
"labs",
"populate_lab_tiles",
Expand Down
1 change: 0 additions & 1 deletion tests/test_client_library_labs.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ def test_create_link(respx_mock, connect_two_nodes):
respx_mock.post("mock://mock/labs/1/links").respond(
json={"id": "l0", "label": "segment0"}
)
respx_mock.get("mock://mock/labs/1/nodes/n0").respond(json={})
session = make_session("mock://mock")
session.lock = MagicMock()
username = password = "test"
Expand Down
1 change: 0 additions & 1 deletion virl2_client/models/lab.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,6 @@ def _create_node_local(
if compute_id is not None:
node._compute_id = compute_id
self._nodes[node.id] = node
self.sync_topology_if_outdated()
return node

@check_stale
Expand Down
2 changes: 1 addition & 1 deletion virl2_client/virl2_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def __init__(
:param events: A flag indicating whether to enable event-based data
synchronization from the server. When enabled, utilizes a mechanism for
receiving real-time updates from the server, instead of periodically
requesting the data.
requesting the data.
:raises InitializationError: If no URL is provided, authentication fails or host
can't be reached.
"""
Expand Down

0 comments on commit 8c217d0

Please sign in to comment.