Commits

Robert Brewer committed 66abbfb

Fix for #315. Removed Python 2.4 dependency (@-syntax), which was killing setup.py under 2.3.

Comments (0)

Files changed (2)

cherrypy/test/cp_decorator_tests.py

-
-import cherrypy
-class Exposing:
-    @cherrypy.expose("1")
-    def base(self):
-        return "expose works!"
-    cherrypy.expose(base, "2")
-
-class ExposingNewStyle(object):
-    @cherrypy.expose("1")
-    def base(self):
-        return "expose works!"
-    cherrypy.expose(base, "2")

cherrypy/test/test_objectmapping.py

 setattr(Root, "Von B\xfclow", mapped_func)
 
 
-if sys.hexversion > 0x020400A2:
-    from cp_decorator_tests import Exposing, ExposingNewStyle
-else:
-    class Exposing:
-        def base(self):
-            return "expose works!"
-        cherrypy.expose(base, "1")
-        cherrypy.expose(base, "2")
-    
-    class ExposingNewStyle(object):
-        def base(self):
-            return "expose works!"
-        cherrypy.expose(base, "1")
-        cherrypy.expose(base, "2")
+class Exposing:
+    def base(self):
+        return "expose works!"
+    cherrypy.expose(base)
+    cherrypy.expose(base, "1")
+    cherrypy.expose(base, "2")
+
+class ExposingNewStyle(object):
+    def base(self):
+        return "expose works!"
+    cherrypy.expose(base)
+    cherrypy.expose(base, "1")
+    cherrypy.expose(base, "2")
 
 
 
     
     def testExpose(self):
         # Test the cherrypy.expose function/decorator
+        self.getPage("/exposing/base")
+        self.assertBody("expose works!")
+        
         self.getPage("/exposing/1")
         self.assertBody("expose works!")
         
         self.getPage("/exposing/2")
         self.assertBody("expose works!")
         
+        self.getPage("/exposingnew/base")
+        self.assertBody("expose works!")
+        
         self.getPage("/exposingnew/1")
         self.assertBody("expose works!")