2 # Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2010
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 from buildfarm.data import BuildStatus
19 from buildfarm.web import html_build_status
23 class BuildStatusHtmlTests(testtools.TestCase):
26 status = BuildStatus()
27 self.assertEquals("?", html_build_status(status))
29 def test_failed_build(self):
30 status = BuildStatus([("CONFIGURE", 0), ("BUILD", 4)])
32 '<span class="status passed">ok</span>/<span class="status failed">4</span>',
33 html_build_status(status))
35 def test_disk_full(self):
36 status = BuildStatus([("CONFIGURE", 0), ("BUILD", 4)], set(["timeout"]))
38 '<span class="status passed">ok</span>/<span class="status failed">4</span>'
39 '(<span class="status failed">timeout</span>)', html_build_status(status))