Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
Signed-off-by: NilashishC <[email protected]>
  • Loading branch information
NilashishC committed Jun 7, 2024
1 parent 7b6a34e commit f21e8ad
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 80 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codecoverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Code Coverage
on:
push:
pull_request:
branches: [ main ]
branches: [main]

jobs:
codecoverage:
Expand Down
Empty file removed tests/unit/compat/__init__.py
Empty file.
28 changes: 0 additions & 28 deletions tests/unit/compat/mock.py

This file was deleted.

41 changes: 0 additions & 41 deletions tests/unit/compat/unittest.py

This file was deleted.

4 changes: 2 additions & 2 deletions tests/unit/mock/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
__metaclass__ = type


from ansible.utils.path import unfrackpath
from unittest.mock import MagicMock

from ansible_collections.frr.frr.tests.unit.compat.mock import MagicMock
from ansible.utils.path import unfrackpath


mock_unfrackpath_noop = MagicMock(spec_set=unfrackpath, side_effect=lambda x, *args, **kwargs: x)
5 changes: 2 additions & 3 deletions tests/unit/mock/procenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@

from contextlib import contextmanager
from io import BytesIO, StringIO
from unittest import TestCase

from ansible.module_utils._text import to_bytes
from ansible.module_utils.six import PY3

from ansible_collections.frr.frr.tests.unit.compat import unittest


@contextmanager
def swap_stdin_and_argv(stdin_data="", argv_data=tuple()):
Expand Down Expand Up @@ -78,7 +77,7 @@ def swap_stdout():
sys.stdout = old_stdout


class ModuleTestCase(unittest.TestCase):
class ModuleTestCase(TestCase):
def setUp(self, module_args=None):
if module_args is None:
module_args = {
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/modules/network/frr/test_frr_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@

__metaclass__ = type

from unittest.mock import patch

from ansible_collections.frr.frr.plugins.modules import frr_facts
from ansible_collections.frr.frr.tests.unit.compat.mock import patch
from ansible_collections.frr.frr.tests.unit.modules.utils import set_module_args

from .frr_module import TestFrrModule, load_fixture
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/modules/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

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.frr.frr.tests.unit.compat import unittest
from ansible_collections.frr.frr.tests.unit.compat.mock import patch


def set_module_args(args):
if "_ansible_remote_tmp" not in args:
Expand Down Expand Up @@ -41,7 +41,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 f21e8ad

Please sign in to comment.