|
@@ 321-337 (lines=17) @@
|
| 318 |
|
get_circuits.assert_called_with(archived="false", metadata={}) |
| 319 |
|
assert response.json() == expected_result |
| 320 |
|
|
| 321 |
|
async def test_list_with_archived_circuits_archived(self): |
| 322 |
|
"""Test if list circuits only archived circuits.""" |
| 323 |
|
circuits = { |
| 324 |
|
'circuits': |
| 325 |
|
{ |
| 326 |
|
"1": {"name": "circuit_1", "archived": True}, |
| 327 |
|
} |
| 328 |
|
} |
| 329 |
|
get_circuits = self.napp.mongo_controller.get_circuits |
| 330 |
|
get_circuits.return_value = circuits |
| 331 |
|
|
| 332 |
|
url = f"{self.base_endpoint}/v2/evc/?archived=true&metadata.a=1" |
| 333 |
|
response = await self.api_client.get(url) |
| 334 |
|
get_circuits.assert_called_with(archived="true", |
| 335 |
|
metadata={"metadata.a": "1"}) |
| 336 |
|
expected_result = {"1": circuits["circuits"]["1"]} |
| 337 |
|
assert response.json() == expected_result |
| 338 |
|
|
| 339 |
|
async def test_list_with_archived_circuits_all(self): |
| 340 |
|
"""Test if list circuits return all circuits.""" |
|
@@ 306-319 (lines=14) @@
|
| 303 |
|
expected_result = circuits["circuits"] |
| 304 |
|
assert response.json() == expected_result |
| 305 |
|
|
| 306 |
|
async def test_list_with_circuits_stored(self): |
| 307 |
|
"""Test if list circuits return all circuits stored.""" |
| 308 |
|
circuits = { |
| 309 |
|
'circuits': |
| 310 |
|
{"1": {"name": "circuit_1"}, "2": {"name": "circuit_2"}} |
| 311 |
|
} |
| 312 |
|
get_circuits = self.napp.mongo_controller.get_circuits |
| 313 |
|
get_circuits.return_value = circuits |
| 314 |
|
|
| 315 |
|
url = f"{self.base_endpoint}/v2/evc/" |
| 316 |
|
response = await self.api_client.get(url) |
| 317 |
|
expected_result = circuits["circuits"] |
| 318 |
|
get_circuits.assert_called_with(archived="false", metadata={}) |
| 319 |
|
assert response.json() == expected_result |
| 320 |
|
|
| 321 |
|
async def test_list_with_archived_circuits_archived(self): |
| 322 |
|
"""Test if list circuits only archived circuits.""" |