Skip to content

Commit

Permalink
fix compat
Browse files Browse the repository at this point in the history
  • Loading branch information
KB-perByte committed Jan 7, 2025
1 parent fd1bb14 commit 5bab220
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions tests/unit/modules/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ def patch_ansible_module(request, mocker):
request.param["ANSIBLE_MODULE_ARGS"]["_ansible_keep_remote_files"] = False
args = json.dumps(request.param)
else:
raise Exception(
"Malformed data to the patch_ansible_module pytest fixture",
)
raise Exception("Malformed data to the patch_ansible_module pytest fixture")

mocker.patch("ansible.module_utils.basic._ANSIBLE_ARGS", to_bytes(args))
8 changes: 4 additions & 4 deletions tests/unit/modules/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
__metaclass__ = type
import json

from unittest import TestCase
from unittest.mock import patch

from ansible.module_utils import basic
from ansible.module_utils._text import to_bytes

from ansible_collections.cisco.asa.tests.unit.compat import unittest
from ansible_collections.cisco.asa.tests.unit.compat.mock import patch


def set_module_args(args):
if "_ansible_remote_tmp" not in args:
Expand Down Expand Up @@ -40,7 +40,7 @@ def fail_json(*args, **kwargs):
raise AnsibleFailJson(kwargs)


class ModuleTestCase(unittest.TestCase):
class ModuleTestCase(TestCase):
def setUp(self):
self.mock_module = patch.multiple(
basic.AnsibleModule,
Expand Down

0 comments on commit 5bab220

Please sign in to comment.