From 53399210692fd0028b4bdad8667af021f6c9ad2e Mon Sep 17 00:00:00 2001 From: Karel van Klink <karel.vanklink@geant.org> Date: Wed, 16 Aug 2023 11:22:08 +0200 Subject: [PATCH] fix linting errors --- lso/__init__.py | 2 +- test/routes/{test_device.py => test_router.py} | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) rename test/routes/{test_device.py => test_router.py} (88%) diff --git a/lso/__init__.py b/lso/__init__.py index 7f48d92..1faa2be 100644 --- a/lso/__init__.py +++ b/lso/__init__.py @@ -5,7 +5,7 @@ from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from lso import config, environment -from lso.routes import default, router, ip_trunk +from lso.routes import default, ip_trunk, router def create_app() -> FastAPI: diff --git a/test/routes/test_device.py b/test/routes/test_router.py similarity index 88% rename from test/routes/test_device.py rename to test/routes/test_router.py index 63fb7c7..167af9d 100644 --- a/test/routes/test_device.py +++ b/test/routes/test_router.py @@ -18,10 +18,10 @@ def test_router_provisioning(client: TestClient) -> None: "dry_run": True, "verb": "deploy", "subscription": { - "device": { + "router": { "ts_address": "127.0.0.1", "ts_port": "1234", - "device_fqdn": "bogus.fqdn.org", + "router_fqdn": "bogus.fqdn.org", "lo_address": {"v4": "1.2.3.4", "v6": "2001:db8::1"}, "lo_iso_address": "1.2.3.4.5.6", "snmp_location": "city,country[1.2,3.4]", @@ -32,13 +32,13 @@ def test_router_provisioning(client: TestClient) -> None: "site_latitude": "0.000", "site_longitude": "0.000", }, - "device_type": "router", - "device_vendor": "vendor", + "router_type": "router", + "router_vendor": "vendor", }, } with patch("lso.playbook.ansible_runner.run", new=test_ansible_runner_run) as _: - rv = client.post("/api/device/", json=params) + rv = client.post("/api/router/", json=params) assert rv.status_code == 200 response = rv.json() # wait two seconds for the run thread to finish -- GitLab