devtools/httptest.py
changeset 9990 c84ad981fc4a
parent 9929 16163ee1cdf9
child 10235 684215aca046
equal deleted inserted replaced
9974:b240b33c7125 9990:c84ad981fc4a
    87 
    87 
    88     Class attributes:
    88     Class attributes:
    89     * `anonymous_allowed`: flag telling if anonymous browsing should be allowed
    89     * `anonymous_allowed`: flag telling if anonymous browsing should be allowed
    90     """
    90     """
    91     configcls = CubicWebServerConfig
    91     configcls = CubicWebServerConfig
    92     # anonymous is logged by default in cubicweb test cases
       
    93     anonymous_allowed = True
       
    94 
    92 
    95     def start_server(self):
    93     def start_server(self):
    96         # use a semaphore to avoid starting test while the http server isn't
    94         # use a semaphore to avoid starting test while the http server isn't
    97         # fully initilialized
    95         # fully initilialized
    98         semaphore = threading.Semaphore(0)
    96         semaphore = threading.Semaphore(0)
   183             self.stop_server()
   181             self.stop_server()
   184         except error.ReactorNotRunning as err:
   182         except error.ReactorNotRunning as err:
   185             # Server could be launched manually
   183             # Server could be launched manually
   186             print err
   184             print err
   187         super(CubicWebServerTC, self).tearDown()
   185         super(CubicWebServerTC, self).tearDown()
   188 
       
   189     @classmethod
       
   190     def init_config(cls, config):
       
   191         config.set_anonymous_allowed(cls.anonymous_allowed)
       
   192         super(CubicWebServerTC, cls).init_config(config)