# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

from ansible_collections.junipernetworks.junos.tests.unit.compat.mock import patch, MagicMock
from ansible_collections.junipernetworks.junos.tests.unit.modules.utils import set_module_args
from ..junos_module import TestJunosModule

jnpr_mock = MagicMock()
modules = {
    'jnpr': jnpr_mock,
    'jnpr.junos': jnpr_mock.junos,
    'jnpr.junos.utils': jnpr_mock.junos.utils,
    'jnpr.junos.utils.sw': jnpr_mock.junos.utils.sw,
}
module_patcher = patch.dict('sys.modules', modules)
module_patcher.start()

from ansible_collections.junipernetworks.junos.plugins.modules import junos_package


class TestJunosPackageModule(TestJunosModule):

    module = junos_package

    def setUp(self):
        super(TestJunosPackageModule, self).setUp()
        self.mock_get_device = patch(
            'ansible_collections.junipernetworks.junos.plugins.modules.junos_package.get_device'
        )
        self.get_device = self.mock_get_device.start()
    patch,
    MagicMock,
)
from ansible_collections.junipernetworks.junos.tests.unit.modules.utils import (
    set_module_args,
)
from .junos_module import TestJunosModule

jnpr_mock = MagicMock()
modules = {
    "jnpr": jnpr_mock,
    "jnpr.junos": jnpr_mock.junos,
    "jnpr.junos.utils": jnpr_mock.junos.utils,
    "jnpr.junos.utils.sw": jnpr_mock.junos.utils.sw,
}
module_patcher = patch.dict("sys.modules", modules)
module_patcher.start()

from ansible_collections.junipernetworks.junos.plugins.modules import (
    junos_package,
)


class TestJunosPackageModule(TestJunosModule):

    module = junos_package

    def setUp(self):
        super(TestJunosPackageModule, self).setUp()
        self.mock_get_device = patch(
            "ansible_collections.junipernetworks.junos.plugins.modules.junos_package.get_device"