cubicweb/web/test/unittest_webconfig.py
branch3.26
changeset 12425 8b3f1d1f0939
parent 12268 d84bc85f7f70
equal deleted inserted replaced
12424:f0a5c2fa2b5d 12425:8b3f1d1f0939
    43         self.assertTrue(isinstance(ie_css, list))
    43         self.assertTrue(isinstance(ie_css, list))
    44 
    44 
    45     def test_locate_resource(self):
    45     def test_locate_resource(self):
    46         self.assertIn('FILE_ICON', self.config.uiprops)
    46         self.assertIn('FILE_ICON', self.config.uiprops)
    47         rname = self.config.uiprops['FILE_ICON'].replace(self.config.datadir_url, '')
    47         rname = self.config.uiprops['FILE_ICON'].replace(self.config.datadir_url, '')
    48         self.assertIn('file', self.config.locate_resource(rname)[0].split(os.sep))
    48         self.assertIn('cubicweb_file', self.config.locate_resource(rname)[0].split(os.sep))
    49         cubicwebcsspath = self.config.locate_resource('cubicweb.css')[0].split(os.sep)
    49         cubicwebcsspath = self.config.locate_resource('cubicweb.css')[0].split(os.sep)
    50 
    50 
    51         # 'shared' if tests under apycot
    51         # 'shared' if tests under apycot
    52         self.assertTrue('web' in cubicwebcsspath or 'shared' in cubicwebcsspath,
    52         self.assertTrue('web' in cubicwebcsspath or 'shared' in cubicwebcsspath,
    53                         'neither "web" nor "shared" found in cubicwebcsspath (%s)'
    53                         'neither "web" nor "shared" found in cubicwebcsspath (%s)'
    55 
    55 
    56     def test_locate_all_files(self):
    56     def test_locate_all_files(self):
    57         wdocfiles = list(self.config.locate_all_files('toc.xml'))
    57         wdocfiles = list(self.config.locate_all_files('toc.xml'))
    58         for fpath in wdocfiles:
    58         for fpath in wdocfiles:
    59             self.assertTrue(path.exists(fpath), fpath)
    59             self.assertTrue(path.exists(fpath), fpath)
    60         for expected in [path.join('cubes', 'file', 'wdoc', 'toc.xml'),
    60         for expected in [path.join('cubicweb_file', 'wdoc', 'toc.xml'),
    61                          path.join('cubicweb', 'web', 'wdoc', 'toc.xml')]:
    61                          path.join('cubicweb', 'web', 'wdoc', 'toc.xml')]:
    62             for fpath in wdocfiles:
    62             for fpath in wdocfiles:
    63                 if fpath.endswith(expected):
    63                 if fpath.endswith(expected):
    64                     break
    64                     break
    65             else:
    65             else: