From 95c516a9f39c625f4d7ce0133b44d8b35f9f50b9 Mon Sep 17 00:00:00 2001 From: Thor77 Date: Sun, 12 Jun 2016 18:36:09 +0200 Subject: [PATCH] make tsstats.tests.test_template.test_online compatible with datetime.timedelta as Client.onlinetime --- tsstats/tests/test_template.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tsstats/tests/test_template.py b/tsstats/tests/test_template.py index a521182..78fe1aa 100644 --- a/tsstats/tests/test_template.py +++ b/tsstats/tests/test_template.py @@ -4,6 +4,7 @@ from os import remove import pytest from bs4 import BeautifulSoup +from datetime import timedelta from tsstats.log import parse_log from tsstats.template import render_template from tsstats.utils import seconds_to_text @@ -53,9 +54,9 @@ def test_onlinetime(soup): # => assert len(items) == len(clients.id) assert len(items) == 2 for client in clients: - if client.nick in nick_data and client.onlinetime > 0: + if client.nick in nick_data and client.onlinetime > timedelta(0): # remove this clause after splitting cients # (uuid-clients will never have a online-time, because # they're only used for bans and kicks) assert nick_data[client.nick] == \ - seconds_to_text(client.onlinetime) + seconds_to_text(int(client.onlinetime.total_seconds()))