devtools/cwwindmill.py
branchstable
changeset 6438 abae10f81a85
parent 6424 f443a2b8a5c7
child 7052 9680cf108821
child 7059 1d65b235549f
equal deleted inserted replaced
6436:275e9f402ccc 6438:abae10f81a85
    33 
    33 
    34 import windmill
    34 import windmill
    35 from windmill.dep import functest
    35 from windmill.dep import functest
    36 from windmill.bin.admin_lib import configure_global_settings, setup, teardown
    36 from windmill.bin.admin_lib import configure_global_settings, setup, teardown
    37 
    37 
    38 from cubicweb.devtools.httptest import CubicWebServerTC
    38 from cubicweb.devtools.httptest import CubicWebServerTC, CubicWebServerConfig
    39 
    39 
    40 
    40 
    41 # Excerpt from :ref:`windmill.authoring.unit`
    41 # Excerpt from :ref:`windmill.authoring.unit`
    42 class UnitTestReporter(functest.reports.FunctestReportInterface):
    42 class UnitTestReporter(functest.reports.FunctestReportInterface):
    43     def summary(self, test_list, totals_dict, stdout_capture):
    43     def summary(self, test_list, totals_dict, stdout_capture):
    44         self.test_list = test_list
    44         self.test_list = test_list
    45 
    45 
    46 unittestreporter = UnitTestReporter()
    46 unittestreporter = UnitTestReporter()
    47 functest.reports.register_reporter(unittestreporter)
    47 functest.reports.register_reporter(unittestreporter)
    48 
       
    49 
       
    50 # Windmill use case are written with no anonymous user
       
    51 from cubicweb.devtools.httptest import CubicWebServerConfig
       
    52 CubicWebServerConfig.anonymous_logged = False
       
    53 
    48 
    54 class CubicWebWindmillUseCase(CubicWebServerTC):
    49 class CubicWebWindmillUseCase(CubicWebServerTC):
    55     """basic class for Windmill use case tests
    50     """basic class for Windmill use case tests
    56 
    51 
    57     If you want to change cubicweb test server parameters, define a new
    52     If you want to change cubicweb test server parameters, define a new
    84 
    79 
    85     Instead of toggle `edit_test` value, try `pytest -i`
    80     Instead of toggle `edit_test` value, try `pytest -i`
    86     """
    81     """
    87     browser = 'firefox'
    82     browser = 'firefox'
    88     edit_test = "-i" in sys.argv # detection for pytest invocation
    83     edit_test = "-i" in sys.argv # detection for pytest invocation
       
    84     # Windmill use case are written with no anonymous user
       
    85     anonymous_logged = False
    89 
    86 
    90     def _test_dir(self):
    87     def _test_dir(self):
    91         """access to class attribute if possible or make assumption
    88         """access to class attribute if possible or make assumption
    92         of expected directory"""
    89         of expected directory"""
    93         try:
    90         try: