[PATCH] [test] Update webconfig's tests accounting for cubicweb-file being now a package

Denis Laxalde denis.laxalde at logilab.fr
Mon Jun 11 16:54:31 CEST 2018

# HG changeset patch
# User Denis Laxalde <denis.laxalde at logilab.fr>
# Date 1528728638 -7200
#      Mon Jun 11 16:50:38 2018 +0200
# Node ID 599a144f5b2539d7dc107392e9af02cb85a05b51
# Parent  f90e0d5c9a647bbd3fe296814facf48f16b34332
# Available At https://hg.logilab.org/review/cubicweb
#              hg pull https://hg.logilab.org/review/cubicweb -r 599a144f5b25
# EXP-Topic cubicweb-file-is-a-package
[test] Update webconfig's tests accounting for cubicweb-file being now a package

WebconfigTC.test_locate_all_files and WebconfigTC.test_locate_resource
assumed that cubicweb-file was installed in <share>/cubes/file whereas,
from the latest release, it is now a standard Python package thus
installed in site-packages as cubicweb_file. We simply update base
directory of these two tests.

diff --git a/cubicweb/web/test/unittest_webconfig.py b/cubicweb/web/test/unittest_webconfig.py
--- a/cubicweb/web/test/unittest_webconfig.py
+++ b/cubicweb/web/test/unittest_webconfig.py
@@ -45,7 +45,7 @@ class WebconfigTC(TestCase):
     def test_locate_resource(self):
         self.assertIn('FILE_ICON', self.config.uiprops)
         rname = self.config.uiprops['FILE_ICON'].replace(self.config.datadir_url, '')
-        self.assertIn('file', self.config.locate_resource(rname)[0].split(os.sep))
+        self.assertIn('cubicweb_file', self.config.locate_resource(rname)[0].split(os.sep))
         cubicwebcsspath = self.config.locate_resource('cubicweb.css')[0].split(os.sep)
         # 'shared' if tests under apycot
@@ -57,7 +57,7 @@ class WebconfigTC(TestCase):
         wdocfiles = list(self.config.locate_all_files('toc.xml'))
         for fpath in wdocfiles:
             self.assertTrue(path.exists(fpath), fpath)
-        for expected in [path.join('cubes', 'file', 'wdoc', 'toc.xml'),
+        for expected in [path.join('cubicweb_file', 'wdoc', 'toc.xml'),
                          path.join('cubicweb', 'web', 'wdoc', 'toc.xml')]:
             for fpath in wdocfiles:
                 if fpath.endswith(expected):

More information about the cubicweb-devel mailing list