From 02e18cf919dc763c813f7aef6be54272688d3c4e Mon Sep 17 00:00:00 2001 From: Alan Rominger Date: Fri, 14 Jan 2022 10:41:24 -0500 Subject: [PATCH] Fix more F811 linter violations --- awx_collection/plugins/lookup/schedule_rrule.py | 6 +----- awx_collection/test/awx/test_credential_input_source.py | 2 +- awx_collection/test/awx/test_workflow_job_template.py | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/awx_collection/plugins/lookup/schedule_rrule.py b/awx_collection/plugins/lookup/schedule_rrule.py index e1079e44ac..c72a9ee6dc 100644 --- a/awx_collection/plugins/lookup/schedule_rrule.py +++ b/awx_collection/plugins/lookup/schedule_rrule.py @@ -90,7 +90,6 @@ from ansible.module_utils.six import raise_from from ansible.plugins.lookup import LookupBase from ansible.errors import AnsibleError from datetime import datetime -from dateutil import rrule try: import pytz @@ -132,10 +131,7 @@ class LookupModule(LookupBase): # plugin constructor def __init__(self, *args, **kwargs): if LIBRARY_IMPORT_ERROR: - raise_from( - AnsibleError('{0}'.format(LIBRARY_IMPORT_ERROR)), - LIBRARY_IMPORT_ERROR - ) + raise_from(AnsibleError('{0}'.format(LIBRARY_IMPORT_ERROR)), LIBRARY_IMPORT_ERROR) super().__init__(*args, **kwargs) @staticmethod diff --git a/awx_collection/test/awx/test_credential_input_source.py b/awx_collection/test/awx/test_credential_input_source.py index 32864da63c..5978939af9 100644 --- a/awx_collection/test/awx/test_credential_input_source.py +++ b/awx_collection/test/awx/test_credential_input_source.py @@ -259,7 +259,7 @@ def source_cred_aim_alt(aim_cred_type): @pytest.mark.django_db -def test_aim_credential_source(run_module, admin_user, organization, source_cred_aim, source_cred_aim_alt, silence_deprecation): +def test_aim_credential_source_change_source(run_module, admin_user, organization, source_cred_aim, source_cred_aim_alt, silence_deprecation): ct = CredentialType.defaults['ssh']() ct.save() tgt_cred = Credential.objects.create(name='Test Machine Credential', organization=organization, credential_type=ct, inputs={'username': 'bob'}) diff --git a/awx_collection/test/awx/test_workflow_job_template.py b/awx_collection/test/awx/test_workflow_job_template.py index c15325cfa9..c5448b23aa 100644 --- a/awx_collection/test/awx/test_workflow_job_template.py +++ b/awx_collection/test/awx/test_workflow_job_template.py @@ -71,7 +71,7 @@ def test_survey_spec_only_changed(run_module, admin_user, organization, survey_s @pytest.mark.django_db -def test_survey_spec_only_changed(run_module, admin_user, organization, survey_spec): +def test_survey_spec_missing_field(run_module, admin_user, organization, survey_spec): wfjt = WorkflowJobTemplate.objects.create(organization=organization, name='foo-workflow', survey_enabled=True, survey_spec=survey_spec) result = run_module('workflow_job_template', {'name': 'foo-workflow', 'organization': organization.name, 'state': 'present'}, admin_user) assert not result.get('failed', False), result.get('msg', result)