Skip to content

Commit 539c73a

Browse files
committed
chore(tests): Restructure API test files for clarity
Moved `AppTest` class to a separate file `test_app.py` for better organization. Simplified imports by removing unused dependencies in `test_access_lists.py`.
1 parent 82a6ea0 commit 539c73a

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

netbox_acls/tests/api/test_access_lists.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
11
from dcim.models import Device, DeviceRole, DeviceType, Manufacturer, Site
22
from django.contrib.contenttypes.models import ContentType
3-
from django.urls import reverse
4-
from rest_framework import status
5-
from utilities.testing import APITestCase, APIViewTestCases
3+
from utilities.testing import APIViewTestCases
64

75
from netbox_acls.choices import *
86
from netbox_acls.models import *
97

108

11-
class AppTest(APITestCase):
12-
def test_root(self):
13-
url = reverse("plugins-api:netbox_acls-api:api-root")
14-
response = self.client.get(f"{url}?format=api", **self.header)
15-
16-
self.assertEqual(response.status_code, status.HTTP_200_OK)
17-
18-
199
class ACLTestCase(
2010
APIViewTestCases.APIViewTestCase,
2111
):

netbox_acls/tests/api/test_app.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from django.urls import reverse
2+
from rest_framework import status
3+
from utilities.testing import APITestCase
4+
5+
6+
class AppTest(APITestCase):
7+
def test_root(self):
8+
"""Test the API root view."""
9+
url = reverse("plugins-api:netbox_acls-api:api-root")
10+
response = self.client.get(f"{url}?format=api", **self.header)
11+
12+
self.assertEqual(response.status_code, status.HTTP_200_OK)

0 commit comments

Comments
 (0)