From 8c96a9dd2a9f81022126677425b613c32038fa5c Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Tue, 14 Feb 2012 18:26:55 +0100 Subject: [PATCH] add tests for sachsen --- modules/sachsen/test.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 modules/sachsen/test.py diff --git a/modules/sachsen/test.py b/modules/sachsen/test.py new file mode 100644 index 00000000..2111e524 --- /dev/null +++ b/modules/sachsen/test.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- + +# Copyright(C) 2010-2012 Romain Bignon +# +# This file is part of weboob. +# +# weboob is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# weboob is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with weboob. If not, see . + + +from weboob.tools.test import BackendTest + +class SachsenTest(BackendTest): + BACKEND = 'sachsen' + + def test_sachsen(self): + l = list(self.backend.iter_gauges()) + self.assertTrue(len(l) > 0) + + gauge = l[0] + history = list(self.backend.iter_gauge_history(gauge.id)) + + self.assertTrue(len(history) > 0) + + self.assertTrue(self.backend.get_last_measure(gauge.id) is not None)