diff --git a/system/lib.py b/system/lib.py index d0240f6a..928109f2 100644 --- a/system/lib.py +++ b/system/lib.py @@ -270,6 +270,14 @@ class BaseTest(object): if a != b: self.verify_match(a, b, match_prepare=pprint.pformat) + def check_ge(self, a, b): + if not a >= b: + raise Exception("%s is not greater or equal to %s" % (a, b)) + + def check_gt(self, a, b): + if not a > b: + raise Exception("%s is not greater to %s" % (a, b)) + def check_in(self, item, l): if not item in l: raise Exception("item %r not in %r", item, l) diff --git a/system/t12_api/graph.py b/system/t12_api/graph.py index 2f2a9f10..0bd1e3a4 100644 --- a/system/t12_api/graph.py +++ b/system/t12_api/graph.py @@ -1,4 +1,5 @@ from api_lib import APITest +import xml.etree.ElementTree as ET class GraphAPITest(APITest): @@ -15,3 +16,20 @@ class GraphAPITest(APITest): resp = self.get("/api/graph.svg") self.check_equal(resp.headers["Content-Type"], "image/svg+xml") self.check_equal(resp.content[:4], '