Skip to content

Commit beea105

Browse files
committed
CHORE: linting: fix linting issues in transform tests.
modified: nautobot_device_onboarding/tests/test_transform.py
1 parent 9b85d1c commit beea105

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

nautobot_device_onboarding/tests/test_transform.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from nautobot.core.testing import TransactionTestCase, run_job_for_testing
1111
from nautobot.extras.choices import JobResultStatusChoices
1212
from nautobot.extras.models import GitRepository, JobResult
13+
1314
from nautobot_device_onboarding.constants import (
1415
ONBOARDING_COMMAND_MAPPERS_CONTENT_IDENTIFIER,
1516
)
@@ -107,12 +108,8 @@ def test_git_repo_was_created(self, MockGitRepo): # pylint:disable=invalid-name
107108
).count()
108109
self.assertEqual(1, repo_count)
109110

110-
@mock.patch(
111-
"nautobot_device_onboarding.nornir_plays.transform.load_command_mappers_from_dir"
112-
)
113-
def test_pull_git_repository_and_refresh_data_with_valid_data(
114-
self, mock_load_command_mappers, MockGitRepo
115-
): # pylint:disable=invalid-name
111+
@mock.patch("nautobot_device_onboarding.nornir_plays.transform.load_command_mappers_from_dir")
112+
def test_pull_git_repository_and_refresh_data_with_valid_data(self, mock_load_command_mappers, MockGitRepo): # pylint:disable=invalid-name
116113
"""
117114
The test_pull_git_repository_and_refresh_data job should succeed if valid data is present in the repo.
118115
"""
@@ -133,9 +130,7 @@ def test_pull_git_repository_and_refresh_data_with_valid_data(
133130
JobResultStatusChoices.STATUS_SUCCESS,
134131
(
135132
job_result.traceback,
136-
list(
137-
job_result.job_log_entries.values_list("message", flat=True)
138-
),
133+
list(job_result.job_log_entries.values_list("message", flat=True)),
139134
),
140135
)
141136
mock_load_command_mappers.side_effect = [
@@ -152,13 +147,12 @@ def test_pull_git_repository_and_refresh_data_with_valid_data(
152147

153148
@mock.patch("nautobot.extras.datasources.git.GitRepo")
154149
class GetGitRepoTestCase(unittest.TestCase):
150+
"""Testing the get_git_repo helper function."""
155151
def setUp(self):
156152
# Create a clean state before each test
157153
super().setUp()
158154
# Clean up any existing repos to ensure a fresh state (safe option)
159-
GitRepository.objects.filter(
160-
provided_contents__contains=ONBOARDING_COMMAND_MAPPERS_CONTENT_IDENTIFIER
161-
).delete()
155+
GitRepository.objects.filter(provided_contents__contains=ONBOARDING_COMMAND_MAPPERS_CONTENT_IDENTIFIER).delete()
162156
self.repo = GitRepository(
163157
name="Test Git Repo",
164158
remote_url="http://localhost/git.git",

0 commit comments

Comments
 (0)