From be6f809581ccbcd6411713128a63711eaa2ce6b7 Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Wed, 16 May 2018 21:35:22 +0900 Subject: Use '_' instead of '-' for python scripts for test --- src/tests/test_vyos_update_crontab.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/tests') diff --git a/src/tests/test_vyos_update_crontab.py b/src/tests/test_vyos_update_crontab.py index efeadf2f5..180871300 100644 --- a/src/tests/test_vyos_update_crontab.py +++ b/src/tests/test_vyos_update_crontab.py @@ -17,17 +17,16 @@ # import os -import sys import tempfile import unittest from vyos import ConfigError -import helper - -file_path = 'src/conf-mode/vyos-update-crontab.py' -module_name = 'vyos_update_crontab' -helper.prepare_module(file_path, module_name) -import vyos_update_crontab +try: + from src.conf_mode import vyos_update_crontab +except ModuleNotFoundError: # for unittest.main() + import sys + sys.path.append(os.path.join(os.path.dirname(__file__), '../..')) + from src.conf_mode import vyos_update_crontab class TestUpdateCrontab(unittest.TestCase): -- cgit v1.2.3