diff --git a/.travis.yml b/.travis.yml index 5aac3330..d4e08829 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,4 +13,4 @@ install: before_script: - sleep 5 script: - - py.test --delete_indexes --ignore tests/loginput --ignore tests/rest tests + - py.test --delete_indexes tests diff --git a/requirements_tests.txt b/requirements_tests.txt index 0b4b3ab2..4ddd4919 100644 --- a/requirements_tests.txt +++ b/requirements_tests.txt @@ -1,2 +1,3 @@ pytest==3.1.1 +mock==2.0.0 WebTest==2.0.27 diff --git a/tests/loginput/loginput_test_suite.py b/tests/loginput/loginput_test_suite.py index 7a741e74..e616cd8e 100644 --- a/tests/loginput/loginput_test_suite.py +++ b/tests/loginput/loginput_test_suite.py @@ -4,6 +4,16 @@ import os sys.path.append(os.path.join(os.path.dirname(__file__), "../")) from http_test_suite import HTTPTestSuite +sys.path.append(os.path.join(os.path.dirname(__file__), "../../lib")) +from utilities.dot_dict import DotDict + +import mock +from configlib import OptionParser + +sample_config = DotDict() +sample_config.configfile = os.path.join(os.path.dirname(__file__), '../../loginput/index.conf') +OptionParser.parse_args = mock.Mock(return_value=(sample_config, {})) + sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../../loginput/")) import index reload(index) diff --git a/tests/rest/rest_test_suite.py b/tests/rest/rest_test_suite.py index 948bcf6e..518ec66c 100644 --- a/tests/rest/rest_test_suite.py +++ b/tests/rest/rest_test_suite.py @@ -4,6 +4,17 @@ import os sys.path.append(os.path.join(os.path.dirname(__file__), "../")) from http_test_suite import HTTPTestSuite +sys.path.append(os.path.join(os.path.dirname(__file__), "../../lib")) +from utilities.dot_dict import DotDict + +import mock +from configlib import OptionParser + +sample_config = DotDict() +sample_config.configfile = os.path.join(os.path.dirname(__file__), '../../rest/index.conf') +OptionParser.parse_args = mock.Mock(return_value=(sample_config, {})) + + sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../../rest/")) import index reload(index) diff --git a/tests/rest/test_rest_index.py b/tests/rest/test_rest_index.py index 0f22f05c..bcac924f 100644 --- a/tests/rest/test_rest_index.py +++ b/tests/rest/test_rest_index.py @@ -66,10 +66,11 @@ class TestKibanaDashboardsRoute(RestTestSuite): json_resp.sort() - assert json_resp[1]['url'].endswith(":9090/index.html#/dashboard/elasticsearch/Example SSH Dashboard") is True + assert json_resp[1]['url'].endswith("/app/kibana#/dashboard/dashboard/Example SSH Dashboard") is True assert json_resp[1]['name'] == 'Example SSH Dashboard' - assert json_resp[0]['url'].endswith(":9090/index.html#/dashboard/elasticsearch/Example FTP Dashboard") is True + + assert json_resp[0]['url'].endswith("/app/kibana#/dashboard/dashboard/Example FTP Dashboard") is True assert json_resp[0]['name'] == 'Example FTP Dashboard'