Merge pull request #22224 from netbox-community/22097-standardize-naming-of-test-classes-followup

Closes #22097: Standardize remaining test class names to TestCase suffix
This commit is contained in:
bctiemann 2026-05-18 19:25:48 -04:00 committed by GitHub
commit f644101fa3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 20 additions and 20 deletions

View File

@ -1008,13 +1008,13 @@ class ExportTemplateContextTestCase(TestCase):
def finalize_none_to_dash(value): def finalize_none_to_dash(value):
""" """
Module-level helper used by RenderTemplateMixinRenderTest.test_environment_params_finalize_path_import. Module-level helper used by RenderTemplateMixinRenderTestCase.test_environment_params_finalize_path_import.
Exported so it can be referenced by dotted path from a Jinja environment_params value. Exported so it can be referenced by dotted path from a Jinja environment_params value.
""" """
return '-' if value is None else value return '-' if value is None else value
class RenderTemplateMixinRenderTest(TestCase): class RenderTemplateMixinRenderTestCase(TestCase):
""" """
Tests for RenderTemplateMixin.render() and get_environment_params(), exercised via ConfigTemplate. Tests for RenderTemplateMixin.render() and get_environment_params(), exercised via ConfigTemplate.
""" """
@ -1094,7 +1094,7 @@ class RenderTemplateMixinRenderTest(TestCase):
self.assertEqual(t.environment_params, {'undefined': 'jinja2.StrictUndefined'}) self.assertEqual(t.environment_params, {'undefined': 'jinja2.StrictUndefined'})
class RenderTemplateMixinResponseTest(TestCase): class RenderTemplateMixinResponseTestCase(TestCase):
""" """
Tests for RenderTemplateMixin.render_to_response() HTTP behavior. Tests for RenderTemplateMixin.render_to_response() HTTP behavior.
""" """
@ -1152,7 +1152,7 @@ class RenderTemplateMixinResponseTest(TestCase):
self.assertEqual(response.content.decode(), rendered) self.assertEqual(response.content.decode(), rendered)
class ExportTemplateRenderTest(TestCase): class ExportTemplateRenderTestCase(TestCase):
""" """
Tests for ExportTemplate.render() with a queryset bound into the template context. Tests for ExportTemplate.render() with a queryset bound into the template context.
""" """
@ -1208,7 +1208,7 @@ class EventRuleTestCase(TestCase):
self.assertIn('action_data', cm.exception.message_dict) self.assertIn('action_data', cm.exception.message_dict)
class JinjaEnvironmentParamsCleanTest(TestCase): class JinjaEnvironmentParamsCleanTestCase(TestCase):
"""Tests for RenderTemplateMixin.clean() validation of environment_params.""" """Tests for RenderTemplateMixin.clean() validation of environment_params."""
def _make_template(self, environment_params): def _make_template(self, environment_params):
@ -1285,7 +1285,7 @@ class JinjaEnvironmentParamsCleanTest(TestCase):
self.assertIn('environment_params', cm.exception.message_dict) self.assertIn('environment_params', cm.exception.message_dict)
class JinjaEnvironmentParamsFilterTest(TestCase): class JinjaEnvironmentParamsFilterTestCase(TestCase):
"""Tests for RenderTemplateMixin._filter_environment_params().""" """Tests for RenderTemplateMixin._filter_environment_params()."""
def test_allowed_keys_pass_through(self): def test_allowed_keys_pass_through(self):
@ -1307,7 +1307,7 @@ class JinjaEnvironmentParamsFilterTest(TestCase):
self.assertEqual(RenderTemplateMixin._filter_environment_params({}), {}) self.assertEqual(RenderTemplateMixin._filter_environment_params({}), {})
class JinjaEnvironmentParamsResolveTest(TestCase): class JinjaEnvironmentParamsResolveTestCase(TestCase):
"""Tests for RenderTemplateMixin._resolve_mapped_params().""" """Tests for RenderTemplateMixin._resolve_mapped_params()."""
def test_undefined_resolved_to_class(self): def test_undefined_resolved_to_class(self):
@ -1329,7 +1329,7 @@ class JinjaEnvironmentParamsResolveTest(TestCase):
self.assertEqual(RenderTemplateMixin._resolve_mapped_params({}), {}) self.assertEqual(RenderTemplateMixin._resolve_mapped_params({}), {})
class JinjaEnvironmentParamsFinalizeTest(TestCase): class JinjaEnvironmentParamsFinalizeTestCase(TestCase):
"""Tests for RenderTemplateMixin._resolve_finalize() legacy carve-out.""" """Tests for RenderTemplateMixin._resolve_finalize() legacy carve-out."""
def test_finalize_string_resolved_via_import_string(self): def test_finalize_string_resolved_via_import_string(self):
@ -1356,7 +1356,7 @@ class JinjaEnvironmentParamsFinalizeTest(TestCase):
self.assertEqual(RenderTemplateMixin._resolve_finalize({}), {}) self.assertEqual(RenderTemplateMixin._resolve_finalize({}), {})
class JinjaEnvironmentParamsIntegrationTest(TestCase): class JinjaEnvironmentParamsIntegrationTestCase(TestCase):
"""Integration tests for get_environment_params() end-to-end.""" """Integration tests for get_environment_params() end-to-end."""
def _make_template(self, environment_params): def _make_template(self, environment_params):

View File

@ -370,7 +370,7 @@ class ExportTemplateTestCase(ViewTestCases.PrimaryObjectViewTestCase):
} }
class ExportTemplateExportFlowTest(TestCase): class ExportTemplateExportFlowTestCase(TestCase):
""" """
End-to-end test for ExportTemplate invocation via a list view's ?export=<name> query param. End-to-end test for ExportTemplate invocation via a list view's ?export=<name> query param.
""" """

View File

@ -9,7 +9,7 @@ from ipam.models import *
from utilities.data import string_to_ranges from utilities.data import string_to_ranges
class TestAggregate(TestCase): class AggregateTestCase(TestCase):
def test_family_string(self): def test_family_string(self):
# Test property when prefix is a string # Test property when prefix is a string
@ -45,7 +45,7 @@ class TestAggregate(TestCase):
self.assertEqual(aggregate.get_utilization(), 100) self.assertEqual(aggregate.get_utilization(), 100)
class TestIPRange(TestCase): class IPRangeTestCase(TestCase):
def test_family_string(self): def test_family_string(self):
# Test property when start_address is a string # Test property when start_address is a string
@ -165,7 +165,7 @@ class TestIPRange(TestCase):
iprange.clean() iprange.clean()
class TestPrefix(TestCase): class PrefixTestCase(TestCase):
def test_family_string(self): def test_family_string(self):
# Test property when prefix is a string # Test property when prefix is a string
@ -424,7 +424,7 @@ class TestPrefix(TestCase):
self.assertRaises(ValidationError, duplicate_prefix.clean) self.assertRaises(ValidationError, duplicate_prefix.clean)
class TestPrefixHierarchy(TestCase): class PrefixHierarchyTestCase(TestCase):
""" """
Test the automatic updating of depth and child count in response to changes made within Test the automatic updating of depth and child count in response to changes made within
the prefix hierarchy. the prefix hierarchy.
@ -622,7 +622,7 @@ class TestPrefixHierarchy(TestCase):
self.assertEqual(prefixes[3]._children, 0) self.assertEqual(prefixes[3]._children, 0)
class TestIPAddress(TestCase): class IPAddressTestCase(TestCase):
def test_family_string(self): def test_family_string(self):
# Test property when address is a string # Test property when address is a string
@ -717,7 +717,7 @@ class TestIPAddress(TestCase):
ipaddress.clean() ipaddress.clean()
class TestVLANGroup(TestCase): class VLANGroupTestCase(TestCase):
@classmethod @classmethod
def setUpTestData(cls): def setUpTestData(cls):
@ -777,7 +777,7 @@ class TestVLANGroup(TestCase):
self.assertEqual(vlangroup.total_vlan_ids, 100) self.assertEqual(vlangroup.total_vlan_ids, 100)
class TestVLAN(TestCase): class VLANTestCase(TestCase):
@classmethod @classmethod
def setUpTestData(cls): def setUpTestData(cls):

View File

@ -15,7 +15,7 @@ from utilities.forms.utils import (
from utilities.forms.widgets.select import AvailableOptions, SelectedOptions from utilities.forms.widgets.select import AvailableOptions, SelectedOptions
class ExpandIPNetwork(TestCase): class ExpandIPNetworkTestCase(TestCase):
""" """
Validate the operation of expand_ipnetwork_pattern(). Validate the operation of expand_ipnetwork_pattern().
""" """
@ -175,7 +175,7 @@ class ExpandIPNetwork(TestCase):
sorted(expand_ipnetwork_pattern('1.2.3.[4,,5]/32', 4)) sorted(expand_ipnetwork_pattern('1.2.3.[4,,5]/32', 4))
class ExpandAlphanumeric(TestCase): class ExpandAlphanumericTestCase(TestCase):
""" """
Validate the operation of expand_alphanumeric_pattern(). Validate the operation of expand_alphanumeric_pattern().
""" """

View File

@ -6,7 +6,7 @@ from ipam.models import VLAN
from vpn.models import * from vpn.models import *
class TestL2VPNTermination(TestCase): class L2VPNTerminationTestCase(TestCase):
@classmethod @classmethod
def setUpTestData(cls): def setUpTestData(cls):