Sort by age rather than by upload time.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 21 Nov 2010 16:40:25 +0000 (17:40 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 21 Nov 2010 16:40:25 +0000 (17:40 +0100)
buildfarm/web/__init__.py
buildfarm/web/tests/test_util.py [deleted file]

index c3ef776a0773fb7fa19688d283395353120fa6ad..4646199361e8c7e7e67b90613dd6c85cab42e434 100755 (executable)
@@ -586,7 +586,7 @@ class ViewRecentBuildsPage(BuildFarmPage):
 
         cmp_funcs = {
             "revision": lambda a, b: cmp(a.revision, b.revision),
-            "age": lambda a, b: cmp(a.upload_time, b.upload_time),
+            "age": lambda a, b: cmp(a.age, b.age),
             "host": lambda a, b: cmp(a.host, b.host),
             "platform": lambda a, b: cmp(build_platform(a), build_platform(b)),
             "compiler": lambda a, b: cmp(a.compiler, b.compiler),
diff --git a/buildfarm/web/tests/test_util.py b/buildfarm/web/tests/test_util.py
deleted file mode 100644 (file)
index d507edd..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/python
-# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2010
-#
-#   This program is free software; you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 3 of the License, or
-#   (at your option) any later version.
-#
-#   This program 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 General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program; if not, write to the Free Software
-#   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-import testtools
-from buildfarm.web import build_link
-
-
-class BuildLinkTests(testtools.TestCase):
-
-    def test_build_link_no_rev(self):
-        self.assertEquals("<a href='myself?function=View+Build;host=charis;tree=tdb;compiler=gcc'>status</a>", build_link("myself", "tdb", "charis", "gcc", None, "status"))
-
-
-    def test_build_link_rev(self):
-        self.assertEquals("<a href='myself?function=View+Build;host=charis;tree=tdb;compiler=gcc;revision=42'>status</a>", build_link("myself", "tdb", "charis", "gcc", "42", "status"))