From daae3514110d12713d156fdc4ba2b08b71f19b65 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Thu, 26 Apr 2018 16:54:42 +0200 Subject: [PATCH] fix travis tests --- .travis.yml | 4 ++-- tests/testHelper.py | 22 ++++++++++++++++++++++ tests/testKeys.py | 12 +++++++----- 3 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 tests/testHelper.py diff --git a/.travis.yml b/.travis.yml index acad5e60..5df803f9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,8 +24,8 @@ script: - ./launch_lvldb.sh - ./launch_logs.sh - ./launch_queues.sh - - nosetests --with-coverage --cover-package=bin -d - - ls + - cd tests + - nosetests --with-coverage --cover-package=../bin -d after_success: diff --git a/tests/testHelper.py b/tests/testHelper.py new file mode 100644 index 00000000..251eef1a --- /dev/null +++ b/tests/testHelper.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import unittest +import sys,os + +sys.path.append(os.environ['AIL_BIN']) + +from Helper import Process + +class TestHelper(unittest.TestCase): + + def setUp(self): + + config_section = 'Keys' + + + def test_Process_Constructor_using_key_module(self): + + conf_section = 'Keys' + process = Process(conf_section) + self.assertEqual(process.subscriber_name, 'Keys') diff --git a/tests/testKeys.py b/tests/testKeys.py index 3559a205..70fe4275 100644 --- a/tests/testKeys.py +++ b/tests/testKeys.py @@ -1,20 +1,22 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +import sys,os import unittest - import magic -from bin.packages.Paste import Paste -import bin.Keys as Keys -from bin.Helper import Process +sys.path.append(os.environ['AIL_BIN']) + +from packages.Paste import Paste +import Keys as Keys +from Helper import Process import pubsublogger class TestKeysModule(unittest.TestCase): def setUp(self): - self.paste = Paste('samples/2018/01/01/keys_certificat_sample.gz') + self.paste = Paste('../samples/2018/01/01/keys_certificat_sample.gz') # Section name in bin/packages/modules.cfg self.config_section = 'Keys'