mirror of
https://github.com/linux-system-roles/network.git
synced 2026-08-02 07:42:13 +00:00
connections unit tests: Fix sys.path manipulation
After moving the unit tests into a subdirectory, the path inserts need to go to one more parent directory.
This commit is contained in:
parent
72cc26a568
commit
d2e7af451e
1 changed files with 3 additions and 3 deletions
|
|
@ -10,8 +10,8 @@ import sys
|
|||
import unittest
|
||||
|
||||
TESTS_BASEDIR = os.path.dirname(os.path.abspath(__file__))
|
||||
sys.path.insert(1, os.path.join(TESTS_BASEDIR, "..", "library"))
|
||||
sys.path.insert(1, os.path.join(TESTS_BASEDIR, "..", "module_utils"))
|
||||
sys.path.insert(1, os.path.join(TESTS_BASEDIR, "../..", "library"))
|
||||
sys.path.insert(1, os.path.join(TESTS_BASEDIR, "../..", "module_utils"))
|
||||
|
||||
try:
|
||||
from unittest import mock
|
||||
|
|
@ -23,7 +23,7 @@ sys.modules["ansible.module_utils.basic"] = mock.Mock()
|
|||
sys.modules["ansible.module_utils"] = mock.Mock()
|
||||
sys.modules["ansible.module_utils.network_lsr"] = __import__("network_lsr")
|
||||
|
||||
# pylint: disable=import-error
|
||||
# pylint: disable=import-error, wrong-import-position
|
||||
import network_lsr
|
||||
import network_connections as n
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue