class TestOptions(TestBase):
    def setUp(self):
        TestBase.setUp(self)
        self.controller = AbstractController()

    def test_options_empty_response(self):
        response = self.controller.options()
        self.assertTrue(response == '')

    def test_options_status_code(self):
        self.controller.options()
        self.assertEqual(cherrypy.response.status,
                         self.controller.NO_CONTENT_STATUS_CODE)

    def test_options_content_length(self):
        self.controller.options()
        self.assertEqual(cherrypy.response.headers['Content-Length'], 0)
Exemple #2
0
class TestOptions(TestBase):
    # TODO: check response code == 204
    # and headers are set correctly...

    def setUp(self):
        TestBase.setUp(self)
        self.controller = AbstractController()

    def _test_options(self, response):
        self.assertTrue(response == '')

    def test_abstract_controller_options(self):
        self.controller.options()

    def test_dataset_controller_options(self):
        controller = Datasets()
        controller.options('dataset_id')

    def test_calculations_controller_options(self):
        controller = Calculations()
        controller.options('dataset_id')
Exemple #3
0
 def setUp(self):
     TestBase.setUp(self)
     self.controller = AbstractController()
 def setUp(self):
     TestBase.setUp(self)
     self.controller = AbstractController()