add test for right identifier in debug-mode

This commit is contained in:
Thor77 2016-06-10 16:22:52 +02:00
parent 5d2e3e00a3
commit 3e5c79fc05
1 changed files with 7 additions and 5 deletions

View File

@ -32,12 +32,14 @@ def test_debug(output):
render_template(clients, output_path)
logger.setLevel(logging.INFO)
soup = BeautifulSoup(open(output_path), 'html.parser')
# check red label
# check debug-label presence
assert soup.find_all(class_='alert alert-danger')
# check ident present after nick
li = soup.find('li')
assert li
assert '(' in li.text.split()[1]
for client_item in soup.find_all('li'):
nick = client_item.find('span').text
# check for right identifier
nick, encl_identifier = nick.split()
identifier = encl_identifier.replace('(', '').replace(')', '')
assert clients[identifier].nick == nick
def test_onlinetime(soup):