Commits

Olemis Lang committed a517793

GViz providers: Adopting Trac=1.0 EnvironmentStub approach to enable/disable components

  • Participants
  • Parent commits d46c206
  • Branches providers

Comments (0)

Files changed (3)

File trac-dev/gviz/TODO

 X Include helper to convert CSV files under version control to GViz 
   API JSON format.
 
+- Fix GViz providers index, broken using Trac=1.0
+
 ~ Write tests for data sources included in TracGViz 1.3.4 that are 
   not about version control.
 

File trac-dev/gviz/tracgviz/testing/__init__.py

   def enable_component(self, clsdef):
     r"""Enable a plugin temporarily at testing time.
     """
-    if clsdef not in self.enabled_components :
-      self.enabled_components.append(clsdef)
+    self.config.set('components', clsdef, 'enabled')
   
   def disable_component(self, clsdef):
     r"""Disable a plugin temporarily at testing time.
     """
-    try:
-      self.enabled_components.remove(clsdef)
-    except ValueError :
-      self.log.warning("Component %s was not enabled", clsdef)
+    self.config.set('components', clsdef, 'disabled')
 
   def rip_component(self, cls):
     r"""Disable a plugin forever and RIP it using the super-laser beam.

File trac-dev/gviz/tracgviz/testing/test_rpc.py

   l = MultiTestLoader(
         [defaultTestLoader, \
           DocTestRpcLoader(extraglobs=magic_vars, \
-                            enable=['trac.[a-uw-z]*', 'tracrpc.*', \
-                                        'tracgviz.*'], \
+                            enable=[
+                                'trac.*', 'tracrpc.*', 'tracgviz.*'
+                              ], \
                             default_data=True,
-                            optionflags=ELLIPSIS | # REPORT_UDIFF | \
+                            optionflags=ELLIPSIS | REPORT_UDIFF | \
                                         NORMALIZE_WHITESPACE) \
         ])