mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-20 10:16:42 -06:00
pycodestyle
This commit is contained in:
parent
4301c06d17
commit
e0037c7f70
@ -261,7 +261,7 @@ class ConsoleServerPortTemplateSerializer(ValidatedModelSerializer):
|
|||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = ConsoleServerPortTemplate
|
model = ConsoleServerPortTemplate
|
||||||
fields = ['id', 'device_type', 'name', 'label', 'type']
|
fields = ['id', 'device_type', 'name', 'label', 'type']
|
||||||
|
|
||||||
|
|
||||||
class PowerPortTemplateSerializer(ValidatedModelSerializer):
|
class PowerPortTemplateSerializer(ValidatedModelSerializer):
|
||||||
@ -274,7 +274,7 @@ class PowerPortTemplateSerializer(ValidatedModelSerializer):
|
|||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = PowerPortTemplate
|
model = PowerPortTemplate
|
||||||
fields = ['id', 'device_type', 'name', 'label', 'type', 'maximum_draw', 'allocated_draw']
|
fields = ['id', 'device_type', 'name', 'label', 'type', 'maximum_draw', 'allocated_draw']
|
||||||
|
|
||||||
|
|
||||||
class PowerOutletTemplateSerializer(ValidatedModelSerializer):
|
class PowerOutletTemplateSerializer(ValidatedModelSerializer):
|
||||||
@ -295,7 +295,7 @@ class PowerOutletTemplateSerializer(ValidatedModelSerializer):
|
|||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = PowerOutletTemplate
|
model = PowerOutletTemplate
|
||||||
fields = ['id', 'device_type', 'name', 'label', 'type', 'power_port', 'feed_leg']
|
fields = ['id', 'device_type', 'name', 'label', 'type', 'power_port', 'feed_leg']
|
||||||
|
|
||||||
|
|
||||||
class InterfaceTemplateSerializer(ValidatedModelSerializer):
|
class InterfaceTemplateSerializer(ValidatedModelSerializer):
|
||||||
@ -446,7 +446,7 @@ class ConsoleServerPortSerializer(TaggitSerializer, ConnectedEndpointSerializer)
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = ConsoleServerPort
|
model = ConsoleServerPort
|
||||||
fields = [
|
fields = [
|
||||||
'id', 'device', 'name', 'label', 'type', 'description', 'connected_endpoint_type', 'connected_endpoint',
|
'id', 'device', 'name', 'label', 'type', 'description', 'connected_endpoint_type', 'connected_endpoint',
|
||||||
'connection_status', 'cable', 'tags',
|
'connection_status', 'cable', 'tags',
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -464,7 +464,7 @@ class ConsolePortSerializer(TaggitSerializer, ConnectedEndpointSerializer):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = ConsolePort
|
model = ConsolePort
|
||||||
fields = [
|
fields = [
|
||||||
'id', 'device', 'name', 'label', 'type', 'description', 'connected_endpoint_type', 'connected_endpoint',
|
'id', 'device', 'name', 'label', 'type', 'description', 'connected_endpoint_type', 'connected_endpoint',
|
||||||
'connection_status', 'cable', 'tags',
|
'connection_status', 'cable', 'tags',
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -494,7 +494,7 @@ class PowerOutletSerializer(TaggitSerializer, ConnectedEndpointSerializer):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = PowerOutlet
|
model = PowerOutlet
|
||||||
fields = [
|
fields = [
|
||||||
'id', 'device', 'name', 'label', 'type', 'power_port', 'feed_leg', 'description', 'connected_endpoint_type',
|
'id', 'device', 'name', 'label', 'type', 'power_port', 'feed_leg', 'description', 'connected_endpoint_type',
|
||||||
'connected_endpoint', 'connection_status', 'cable', 'tags',
|
'connected_endpoint', 'connection_status', 'cable', 'tags',
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -512,7 +512,7 @@ class PowerPortSerializer(TaggitSerializer, ConnectedEndpointSerializer):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = PowerPort
|
model = PowerPort
|
||||||
fields = [
|
fields = [
|
||||||
'id', 'device', 'name', 'label', 'type', 'maximum_draw', 'allocated_draw', 'description', 'connected_endpoint_type',
|
'id', 'device', 'name', 'label', 'type', 'maximum_draw', 'allocated_draw', 'description', 'connected_endpoint_type',
|
||||||
'connected_endpoint', 'connection_status', 'cable', 'tags',
|
'connected_endpoint', 'connection_status', 'cable', 'tags',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ class LabelTestCase(TestCase):
|
|||||||
cls.device = Device.objects.create(
|
cls.device = Device.objects.create(
|
||||||
name='Device 2', device_type=cls.device_type, device_role=device_role, site=site
|
name='Device 2', device_type=cls.device_type, device_role=device_role, site=site
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_interface_label_count_valid(self):
|
def test_interface_label_count_valid(self):
|
||||||
good_interface_data = {
|
good_interface_data = {
|
||||||
'device': self.device.pk,
|
'device': self.device.pk,
|
||||||
@ -143,7 +143,7 @@ class LabelTestCase(TestCase):
|
|||||||
'type': InterfaceTypeChoices.TYPE_100ME_FIXED,
|
'type': InterfaceTypeChoices.TYPE_100ME_FIXED,
|
||||||
}
|
}
|
||||||
form = InterfaceCreateForm(good_interface_data)
|
form = InterfaceCreateForm(good_interface_data)
|
||||||
|
|
||||||
print(form.errors)
|
print(form.errors)
|
||||||
self.assertTrue(form.is_valid())
|
self.assertTrue(form.is_valid())
|
||||||
|
|
||||||
@ -159,7 +159,7 @@ class LabelTestCase(TestCase):
|
|||||||
|
|
||||||
self.assertFalse(form.is_valid())
|
self.assertFalse(form.is_valid())
|
||||||
self.assertIn('label_pattern', form.errors)
|
self.assertIn('label_pattern', form.errors)
|
||||||
|
|
||||||
def test_console_port_template_label_count_valid(self):
|
def test_console_port_template_label_count_valid(self):
|
||||||
bad_console_port_template_data = {
|
bad_console_port_template_data = {
|
||||||
'device_type': self.device_type,
|
'device_type': self.device_type,
|
||||||
|
Loading…
Reference in New Issue
Block a user