Module: check_mk
Branch: master
Commit: 513ca12d83f407da58bfc4e7f30e8bb8b97c92ff
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=513ca12d83f407…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Sep 8 18:23:25 2016 +0200
Slightly improved site / web tests
---
tests/testlib/__init__.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py
index 9555e1a..b8f0467 100644
--- a/tests/testlib/__init__.py
+++ b/tests/testlib/__init__.py
@@ -13,7 +13,7 @@ import pipes
import subprocess
from urlparse import urlparse
-from BeautifulSoup import BeautifulSoup
+from bs4 import BeautifulSoup
# Disable insecure requests warning message during SSL testing
from requests.packages.urllib3.exceptions import InsecureRequestWarning
@@ -271,6 +271,8 @@ class Site(object):
# Not free of races, but should be sufficient.
def open_livestatus_tcp(self):
if self.is_running():
+ assert self.get_config("LIVESTATUS_TCP") == "on", \
+ "Livestatus-TCP disabled (Site is running, so could not enable
it)"
return
self.set_config("LIVESTATUS_TCP", "on")
@@ -406,7 +408,7 @@ class WebSession(requests.Session):
def _check_html_page_resources(self, response):
- soup = BeautifulSoup(response.text)
+ soup = BeautifulSoup(response.text, "lxml")
parsed_url = urlparse(response.url)