summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-10-25 19:37:43 +0100
committerChristian Poessinger <christian@poessinger.com>2020-10-25 19:39:05 +0100
commitd1de4e0ae8d742b3e566fe662e425d319a35e380 (patch)
treec19707d5ef5cdd64e27b852ce59ca70e92d98658 /src/tests
parent44c57a59f24b32a384bdf42c3097882f6c32169e (diff)
downloadvyos-1x-d1de4e0ae8d742b3e566fe662e425d319a35e380.tar.gz
vyos-1x-d1de4e0ae8d742b3e566fe662e425d319a35e380.zip
test: import cleanup
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/helper.py3
-rw-r--r--src/tests/test_config_parser.py4
-rwxr-xr-xsrc/tests/test_find_device_file.py2
-rw-r--r--src/tests/test_util.py6
-rw-r--r--src/tests/test_vyos_dict_search.py2
5 files changed, 3 insertions, 14 deletions
diff --git a/src/tests/helper.py b/src/tests/helper.py
index a7e4f201c..f7033148a 100644
--- a/src/tests/helper.py
+++ b/src/tests/helper.py
@@ -13,13 +13,10 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-#
import sys
import importlib.util
-
def prepare_module(file_path='', module_name=''):
spec = importlib.util.spec_from_file_location(module_name, file_path)
module = importlib.util.module_from_spec(spec)
diff --git a/src/tests/test_config_parser.py b/src/tests/test_config_parser.py
index 5b922e2dd..6e0a071f8 100644
--- a/src/tests/test_config_parser.py
+++ b/src/tests/test_config_parser.py
@@ -15,11 +15,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
-import tempfile
-import unittest
+import vyos.configtree
from unittest import TestCase
-import vyos.configtree
class TestConfigParser(TestCase):
def setUp(self):
diff --git a/src/tests/test_find_device_file.py b/src/tests/test_find_device_file.py
index 8cf50b32d..43c80dc76 100755
--- a/src/tests/test_find_device_file.py
+++ b/src/tests/test_find_device_file.py
@@ -14,9 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import unittest
from unittest import TestCase
-
from vyos.util import find_device_file
class TestDeviceFile(TestCase):
diff --git a/src/tests/test_util.py b/src/tests/test_util.py
index 09bf947b8..f7405cbde 100644
--- a/src/tests/test_util.py
+++ b/src/tests/test_util.py
@@ -14,10 +14,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import unittest
from unittest import TestCase
-
-import vyos.util
+from vyos.util import mangle_dict_keys
class TestVyOSUtil(TestCase):
@@ -27,6 +25,6 @@ class TestVyOSUtil(TestCase):
def test_key_mangline(self):
data = {"foo-bar": {"baz-quux": None}}
expected_data = {"foo_bar": {"baz_quux": None}}
- new_data = vyos.util.mangle_dict_keys(data, '-', '_')
+ new_data = mangle_dict_keys(data, '-', '_')
self.assertEqual(new_data, expected_data)
diff --git a/src/tests/test_vyos_dict_search.py b/src/tests/test_vyos_dict_search.py
index ef338d46f..cba6562da 100644
--- a/src/tests/test_vyos_dict_search.py
+++ b/src/tests/test_vyos_dict_search.py
@@ -14,9 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import unittest
from unittest import TestCase
-
from vyos.util import vyos_dict_search
data = {