summaryrefslogtreecommitdiffstats
path: root/roles/openshift_health_checker/test/kibana_test.py
diff options
context:
space:
mode:
authorOpenShift Bot <eparis+openshiftbot@redhat.com>2017-08-02 06:16:32 -0400
committerGitHub <noreply@github.com>2017-08-02 06:16:32 -0400
commitb22ebdcce1c5ffea48cf95695d654d112da5c812 (patch)
tree3122d150cc46d2b28e3c9908b04bf2c714822412 /roles/openshift_health_checker/test/kibana_test.py
parentbeb5deaedb105acd113807597858069a38553952 (diff)
parent04154a21237f9da6ee64bf57097d125b85b99a5f (diff)
downloadopenshift-b22ebdcce1c5ffea48cf95695d654d112da5c812.tar.gz
openshift-b22ebdcce1c5ffea48cf95695d654d112da5c812.tar.bz2
openshift-b22ebdcce1c5ffea48cf95695d654d112da5c812.tar.xz
openshift-b22ebdcce1c5ffea48cf95695d654d112da5c812.zip
Merge pull request #4592 from juanvallejo/jvallejo/verify-fluentd-logging-config
Merged by openshift-bot
Diffstat (limited to 'roles/openshift_health_checker/test/kibana_test.py')
-rw-r--r--roles/openshift_health_checker/test/kibana_test.py15
1 files changed, 4 insertions, 11 deletions
diff --git a/roles/openshift_health_checker/test/kibana_test.py b/roles/openshift_health_checker/test/kibana_test.py
index 3a880d300..0bf492511 100644
--- a/roles/openshift_health_checker/test/kibana_test.py
+++ b/roles/openshift_health_checker/test/kibana_test.py
@@ -11,14 +11,6 @@ except ImportError:
from openshift_checks.logging.kibana import Kibana
-def canned_kibana(exec_oc=None):
- """Create a Kibana check object with canned exec_oc method"""
- check = Kibana() # fails if a module is actually invoked
- if exec_oc:
- check._exec_oc = exec_oc
- return check
-
-
def assert_error(error, expect_error):
if expect_error:
assert error
@@ -68,7 +60,7 @@ not_running_kibana_pod = {
),
])
def test_check_kibana(pods, expect_error):
- check = canned_kibana()
+ check = Kibana()
error = check.check_kibana(pods)
assert_error(error, expect_error)
@@ -137,7 +129,8 @@ def test_check_kibana(pods, expect_error):
),
])
def test_get_kibana_url(route, expect_url, expect_error):
- check = canned_kibana(exec_oc=lambda cmd, args: json.dumps(route) if route else "")
+ check = Kibana()
+ check.exec_oc = lambda ns, cmd, args: json.dumps(route) if route else ""
url, error = check._get_kibana_url()
if expect_url:
@@ -210,7 +203,7 @@ def test_verify_url_external_failure(lib_result, expect, monkeypatch):
raise lib_result
monkeypatch.setattr(urllib2, 'urlopen', urlopen)
- check = canned_kibana()
+ check = Kibana()
check._get_kibana_url = lambda: ('url', None)
check._verify_url_internal = lambda url: None