incubator-bloodhound-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g..@apache.org
Subject svn commit: r1307956 - in /incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard: tests/__init__.py tests/test_report.py util.py
Date Sun, 01 Apr 2012 00:25:40 GMT
Author: gjm
Date: Sun Apr  1 00:25:40 2012
New Revision: 1307956

URL: http://svn.apache.org/viewvc?rev=1307956&view=rev
Log:
Dashboard code import: BH_Dashboard: TracDuTest framework now runs using Trac>=0.13

Modified:
    incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/tests/__init__.py
    incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/tests/test_report.py
    incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/util.py

Modified: incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/tests/__init__.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/tests/__init__.py?rev=1307956&r1=1307955&r2=1307956&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/tests/__init__.py (original)
+++ incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/tests/__init__.py Sun Apr
 1 00:25:40 2012
@@ -29,9 +29,17 @@ from trac.mimeview.api import Context
 from trac.test import EnvironmentStub
 from trac.util.compat import set
 
+from pkg_resources import get_distribution
 import sys
 
 #------------------------------------------------------
+#    Context information
+#------------------------------------------------------
+
+trac_version = tuple(int(i) for i in get_distribution('Trac').parsed_version \
+                            if i.startswith('0'))
+
+#------------------------------------------------------
 #    Trac environments used for testing purposes
 #------------------------------------------------------
 
@@ -248,7 +256,10 @@ class DocTestTracLoader(DocTestLoader):
       db = self.env.get_db_cnx()
       cursor = db.cursor()
       for table in db_default.schema:
-        cursor.execute("DELETE FROM " + table.name)
+        if trac_version < (0, 13) : # FIXME: Should it be (0, 12)
+            cursor.execute("DELETE FROM " + table.name)
+        else:
+            cursor.execute("DROP TABLE " + table.name)
       db.commit()
 
       self.env.reset_db(default_data=True)

Modified: incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/tests/test_report.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/tests/test_report.py?rev=1307956&r1=1307955&r2=1307956&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/tests/test_report.py (original)
+++ incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/tests/test_report.py Sun Apr
 1 00:25:40 2012
@@ -132,10 +132,8 @@ __test__ = {
       >>> from bhdashboard.api import IWidgetProvider
       >>> from bhdashboard.widgets.report import *
       >>> allcls = ComponentMeta._registry.get(IWidgetProvider, [])
-      >>> for wpcls in (TicketReportWidget,):
-      ...   print wpcls in allcls
-      ...
-      True
+      >>> [wpcls in allcls for wpcls in (TicketReportWidget,)]
+      [True]
       """,
     '|TicketReport: Metadata' : r"""
       >>> list(widget.get_widgets())

Modified: incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/util.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/util.py?rev=1307956&r1=1307955&r2=1307956&view=diff
==============================================================================
--- incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/util.py (original)
+++ incubator/bloodhound/trunk/bloodhound_dashboard/bhdashboard/util.py Sun Apr  1 00:25:40
2012
@@ -52,7 +52,7 @@ def dummy_request(env, uname=None):
     req.callbacks.update({
         'authname': rd.authenticate,
         'chrome': chrome.prepare_request,
-        'hdf': rd._get_hdf,
+        'hdf': getattr(rd, '_get_hdf', None),
         'perm': rd._get_perm,
         'session': rd._get_session,
         'tz': rd._get_timezone,



Mime
View raw message