Use render_servers instead of render_template

This commit is contained in:
Thor77 2016-11-23 21:00:35 +01:00
parent 418be10603
commit a3d4cdde5b
1 changed files with 5 additions and 4 deletions

View File

@ -5,12 +5,13 @@ from os import remove
import pytest
from bs4 import BeautifulSoup
from tsstats.log import _parse_details
from tsstats.template import render_template
from tsstats.log import _parse_details, Server
from tsstats.template import render_servers
from tsstats.utils import filter_threshold, seconds_to_text, sort_clients
output_path = 'tsstats/tests/res/output.html'
clients = _parse_details('tsstats/tests/res/test.log', online_dc=False)
servers = [Server(1, clients)]
logger = logging.getLogger('tsstats')
@ -24,13 +25,13 @@ def output(request):
@pytest.fixture
def soup(output):
render_template(clients, output_path)
render_servers(servers, output_path)
return BeautifulSoup(open(output_path), 'html.parser')
def test_debug(output):
logger.setLevel(logging.DEBUG)
render_template(clients, output_path)
render_servers(servers, output_path)
logger.setLevel(logging.INFO)
soup = BeautifulSoup(open(output_path), 'html.parser')
# check debug-label presence