summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2018-05-16 16:01:38 +0200
committerDaniil Baturin <daniil@baturin.org>2018-05-16 16:02:33 +0200
commitd4c10902026b76a6372cf738fc98860b29b39759 (patch)
treec8d3958d564f876b74e80f68727bbe5f02a57aed /src/tests
parentbe6f809581ccbcd6411713128a63711eaa2ce6b7 (diff)
downloadvyos-1x-d4c10902026b76a6372cf738fc98860b29b39759.tar.gz
vyos-1x-d4c10902026b76a6372cf738fc98860b29b39759.zip
T644: remove prefixing from all scripts and update environment variables with VyOS paths.
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/test_vyos_update_crontab.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/tests/test_vyos_update_crontab.py b/src/tests/test_vyos_update_crontab.py
index 180871300..7acbbddc5 100644
--- a/src/tests/test_vyos_update_crontab.py
+++ b/src/tests/test_vyos_update_crontab.py
@@ -22,11 +22,11 @@ import unittest
from vyos import ConfigError
try:
- from src.conf_mode import vyos_update_crontab
+ from src.conf_mode import task_scheduler
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
+ from src.conf_mode import task_scheduler
class TestUpdateCrontab(unittest.TestCase):
@@ -74,9 +74,9 @@ class TestUpdateCrontab(unittest.TestCase):
with self.subTest(msg=t['name'], tasks=t['tasks'], expected=t['expected']):
if t['expected'] is not None:
with self.assertRaises(t['expected']):
- vyos_update_crontab.verify(t['tasks'])
+ task_scheduler.verify(t['tasks'])
else:
- vyos_update_crontab.verify(t['tasks'])
+ task_scheduler.verify(t['tasks'])
def test_generate(self):
tests = [
@@ -114,16 +114,16 @@ class TestUpdateCrontab(unittest.TestCase):
]
for t in tests:
with self.subTest(msg=t['name'], tasks=t['tasks'], expected=t['expected']):
- vyos_update_crontab.crontab_file = tempfile.mkstemp()[1]
- vyos_update_crontab.generate(t['tasks'])
+ task_scheduler.crontab_file = tempfile.mkstemp()[1]
+ task_scheduler.generate(t['tasks'])
if len(t['expected']) > 0:
- self.assertTrue(os.path.isfile(vyos_update_crontab.crontab_file))
- with open(vyos_update_crontab.crontab_file) as f:
+ self.assertTrue(os.path.isfile(task_scheduler.crontab_file))
+ with open(task_scheduler.crontab_file) as f:
actual = f.read()
self.assertEqual(t['expected'], actual.splitlines())
- os.remove(vyos_update_crontab.crontab_file)
+ os.remove(task_scheduler.crontab_file)
else:
- self.assertFalse(os.path.isfile(vyos_update_crontab.crontab_file))
+ self.assertFalse(os.path.isfile(task_scheduler.crontab_file))
if __name__ == "__main__":