Wrap ComponentTraceMixin in a parent class

This commit is contained in:
Jeremy Stretch 2020-06-29 15:14:12 -04:00
parent 36498c9dd2
commit 15f32bdd73

View File

@ -28,7 +28,9 @@ class AppTest(APITestCase):
self.assertEqual(response.status_code, 200)
class ComponentTraceMixin(APITestCase):
class Mixins:
class ComponentTraceMixin(APITestCase):
peer_termination_type = None
def test_trace(self):
@ -956,7 +958,7 @@ class DeviceTest(APIViewTestCases.APIViewTestCase):
self.assertHttpStatus(response, status.HTTP_400_BAD_REQUEST)
class ConsolePortTest(ComponentTraceMixin, APIViewTestCases.APIViewTestCase):
class ConsolePortTest(Mixins.ComponentTraceMixin, APIViewTestCases.APIViewTestCase):
model = ConsolePort
brief_fields = ['cable', 'connection_status', 'device', 'id', 'name', 'url']
peer_termination_type = ConsoleServerPort
@ -992,7 +994,7 @@ class ConsolePortTest(ComponentTraceMixin, APIViewTestCases.APIViewTestCase):
]
class ConsoleServerPortTest(ComponentTraceMixin, APIViewTestCases.APIViewTestCase):
class ConsoleServerPortTest(Mixins.ComponentTraceMixin, APIViewTestCases.APIViewTestCase):
model = ConsoleServerPort
brief_fields = ['cable', 'connection_status', 'device', 'id', 'name', 'url']
peer_termination_type = ConsolePort
@ -1028,7 +1030,7 @@ class ConsoleServerPortTest(ComponentTraceMixin, APIViewTestCases.APIViewTestCas
]
class PowerPortTest(ComponentTraceMixin, APIViewTestCases.APIViewTestCase):
class PowerPortTest(Mixins.ComponentTraceMixin, APIViewTestCases.APIViewTestCase):
model = PowerPort
brief_fields = ['cable', 'connection_status', 'device', 'id', 'name', 'url']
peer_termination_type = PowerOutlet
@ -1064,7 +1066,7 @@ class PowerPortTest(ComponentTraceMixin, APIViewTestCases.APIViewTestCase):
]
class PowerOutletTest(ComponentTraceMixin, APIViewTestCases.APIViewTestCase):
class PowerOutletTest(Mixins.ComponentTraceMixin, APIViewTestCases.APIViewTestCase):
model = PowerOutlet
brief_fields = ['cable', 'connection_status', 'device', 'id', 'name', 'url']
peer_termination_type = PowerPort
@ -1100,7 +1102,7 @@ class PowerOutletTest(ComponentTraceMixin, APIViewTestCases.APIViewTestCase):
]
class InterfaceTest(ComponentTraceMixin, APIViewTestCases.APIViewTestCase):
class InterfaceTest(Mixins.ComponentTraceMixin, APIViewTestCases.APIViewTestCase):
model = Interface
brief_fields = ['cable', 'connection_status', 'device', 'id', 'name', 'url']
peer_termination_type = Interface
@ -1174,7 +1176,7 @@ class InterfaceTest(ComponentTraceMixin, APIViewTestCases.APIViewTestCase):
self.assertEqual(response.data[0]['embed_url'], 'http://example.com/graphs.py?interface=Interface 1&foo=1')
class FrontPortTest(ComponentTraceMixin, APIViewTestCases.APIViewTestCase):
class FrontPortTest(Mixins.ComponentTraceMixin, APIViewTestCases.APIViewTestCase):
model = FrontPort
brief_fields = ['cable', 'device', 'id', 'name', 'url']
peer_termination_type = Interface
@ -1229,7 +1231,7 @@ class FrontPortTest(ComponentTraceMixin, APIViewTestCases.APIViewTestCase):
]
class RearPortTest(ComponentTraceMixin, APIViewTestCases.APIViewTestCase):
class RearPortTest(Mixins.ComponentTraceMixin, APIViewTestCases.APIViewTestCase):
model = RearPort
brief_fields = ['cable', 'device', 'id', 'name', 'url']
peer_termination_type = Interface