Beispiel #1
0
 def __init__(self):
     Resource.__init__(self, model)
     self.description = Description(model)
     self.rectangles = Rectangles(model)
     self.circles = Circles(model)
     self.api_schema = json.load(open(os.path.join(os.path.dirname(
                                 os.path.abspath(__file__)), 'API.json')))
Beispiel #2
0
 def __init__(self):
     Resource.__init__(self, model)
     self.description = Description(model)
     self.rectangles = Rectangles(model)
     self.circles = Circles(model)
     self.paths = PluginPaths("sample")
     self.domain = "sample"
     self.messages = messages
     self.api_schema = json.load(open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "API.json")))
Beispiel #3
0
 def __init__(self):
     Resource.__init__(self, model)
     self.description = Description(model)
     self.rectangles = Rectangles(model)
     self.circles = Circles(model)
     self.paths = PluginPaths('sample')
     self.domain = 'sample'
     self.messages = messages
     self.api_schema = json.load(open(os.path.join(os.path.dirname(
                                 os.path.abspath(__file__)), 'API.json')))
Beispiel #4
0
    def test_resource(self):
        r = Resource(model)

        # Test the base Resource representation
        cherrypy.request.method = 'GET'
        self.assertEquals('{}', r.index())

        # POST and DELETE raise HTTP:405 by default
        for method in ('POST', 'DELETE'):
            cherrypy.request.method = method
            try:
                r.index()
            except cherrypy.HTTPError, e:
                self.assertEquals(405, e.code)
            else:
                self.fail("Expected exception not raised")
Beispiel #5
0
    def test_resource(self):
        r = Resource(model)

        # Test the base Resource representation
        cherrypy.request.method = 'GET'
        self.assertEquals('{}', r.index())

        # POST and DELETE raise HTTP:405 by default
        for method in ('POST', 'DELETE'):
            cherrypy.request.method = method
            try:
                r.index()
            except cherrypy.HTTPError, e:
                self.assertEquals(405, e.code)
            else:
                self.fail("Expected exception not raised")