зеркало из https://github.com/mozilla/MozDef.git
Fix loginput and rest unit tests
This commit is contained in:
Родитель
93dbb4ae72
Коммит
95e4d2cd69
|
@ -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
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
pytest==3.1.1
|
||||
mock==2.0.0
|
||||
WebTest==2.0.27
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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'
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче