[test] drop CubicWebConfigurationWithLegacyCubesTC
authorPhilippe Pepiot <philippe.pepiot@logilab.fr>
Fri, 15 Mar 2019 17:12:20 +0100
changeset 12517 34c4157b1071
parent 12516 ec089debcd45
child 12518 12e8b65146d9
[test] drop CubicWebConfigurationWithLegacyCubesTC This is used to test legacy cube import which is planned for removal in cubicweb 3.27, so drop the code.
cubicweb/test/data/legacy_cubes/comment
cubicweb/test/data/legacy_cubes/email
cubicweb/test/data/legacy_cubes/file
cubicweb/test/data/legacy_cubes/forge
cubicweb/test/data/legacy_cubes/mycube
cubicweb/test/unittest_cwconfig.py
tox.ini
--- a/cubicweb/test/data/legacy_cubes/comment	Fri Mar 15 17:10:16 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-../libpython/cubicweb_comment
\ No newline at end of file
--- a/cubicweb/test/data/legacy_cubes/email	Fri Mar 15 17:10:16 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-../libpython/cubicweb_email/
\ No newline at end of file
--- a/cubicweb/test/data/legacy_cubes/file	Fri Mar 15 17:10:16 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-../libpython/cubicweb_file
\ No newline at end of file
--- a/cubicweb/test/data/legacy_cubes/forge	Fri Mar 15 17:10:16 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-../libpython/cubicweb_forge
\ No newline at end of file
--- a/cubicweb/test/data/legacy_cubes/mycube	Fri Mar 15 17:10:16 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-../libpython/cubicweb_mycube
\ No newline at end of file
--- a/cubicweb/test/unittest_cwconfig.py	Fri Mar 15 17:10:16 2019 +0100
+++ b/cubicweb/test/unittest_cwconfig.py	Fri Mar 15 17:12:20 2019 +0100
@@ -187,72 +187,6 @@
         self.assertNotIn('cubes.mycube.ccplugin', sys.modules, sorted(sys.modules))
         self.assertIn('cubicweb_mycube.ccplugin', sys.modules, sorted(sys.modules))
 
-
-class CubicWebConfigurationWithLegacyCubesTC(CubicWebConfigurationTC):
-
-    @classmethod
-    def setUpClass(cls):
-        pass
-
-    @classmethod
-    def tearDownClass(cls):
-        pass
-
-    def setUp(self):
-        self.custom_cubes_dir = self.datapath('legacy_cubes')
-        cleanup_sys_modules([self.custom_cubes_dir, ApptestConfiguration.CUBES_DIR])
-        super(CubicWebConfigurationWithLegacyCubesTC, self).setUp()
-        self.config.__class__.CUBES_PATH = [self.custom_cubes_dir]
-        self.config.adjust_sys_path()
-
-    def tearDown(self):
-        ApptestConfiguration.CUBES_PATH = []
-
-    def test_available_cubes(self):
-        expected_cubes = [
-            'card',
-            'comment',
-            'email',
-            'file',
-            'forge',
-            'cubicweb_localperms',
-            'mycube',
-            'tag',
-        ]
-        self.assertEqual(self.config.available_cubes(), expected_cubes)
-
-    def test_reorder_cubes_recommends(self):
-        from cubes.comment import __pkginfo__ as comment_pkginfo
-        self._test_reorder_cubes_recommends(comment_pkginfo)
-
-    def test_cubes_path(self):
-        # make sure we don't import the email cube, but the stdlib email package
-        import email
-        self.assertNotEqual(dirname(email.__file__), self.config.CUBES_DIR)
-        self.config.__class__.CUBES_PATH = [self.custom_cubes_dir]
-        self.assertEqual(self.config.cubes_search_path(),
-                         [self.custom_cubes_dir, self.config.CUBES_DIR])
-        self.config.__class__.CUBES_PATH = [self.custom_cubes_dir,
-                                            self.config.CUBES_DIR, 'unexistant']
-        # filter out unexistant and duplicates
-        self.assertEqual(self.config.cubes_search_path(),
-                         [self.custom_cubes_dir,
-                          self.config.CUBES_DIR])
-        self.assertIn('mycube', self.config.available_cubes())
-        # test cubes python path
-        self.config.adjust_sys_path()
-        import cubes
-        self.assertEqual(cubes.__path__, self.config.cubes_search_path())
-        # this import should succeed once path is adjusted
-        from cubes import mycube
-        self.assertEqual(mycube.__path__, [join(self.custom_cubes_dir, 'mycube')])
-        # file cube should be overriden by the one found in data/cubes
-        sys.modules.pop('cubes.file')
-        if hasattr(cubes, 'file'):
-            del cubes.file
-        from cubes import file
-        self.assertEqual(file.__path__, [join(self.custom_cubes_dir, 'file')])
-
     def test_config_value_from_environment_str(self):
         self.assertIsNone(self.config['base-url'])
         os.environ['CW_BASE_URL'] = 'https://www.cubicweb.org'
@@ -280,11 +214,6 @@
         finally:
             del os.environ['CW_ALLOW_EMAIL_LOGIN']
 
-    def test_ccplugin_modname(self):
-        self.config.load_cwctl_plugins()
-        self.assertIn('cubes.mycube.ccplugin', sys.modules, sorted(sys.modules))
-        self.assertNotIn('cubicweb_mycube.ccplugin', sys.modules, sorted(sys.modules))
-
 
 class ModnamesTC(unittest.TestCase):
 
--- a/tox.ini	Fri Mar 15 17:10:16 2019 +0100
+++ b/tox.ini	Fri Mar 15 17:12:20 2019 +0100
@@ -43,7 +43,7 @@
   {envpython} -m check_manifest {toxinidir} \
 # ignore symlinks that are not recognized by check-manifest, see
 # https://github.com/mgedmin/check-manifest/issues/69
-    --ignore cubicweb/devtools/test/data/cubes/i18ntestcube*,cubicweb/test/data/legacy_cubes*,cubicweb/server/test/data-migractions/cubicweb_*,cubicweb/server/test/data-migractions/migratedapp/cubicweb_*
+    --ignore cubicweb/devtools/test/data/cubes/i18ntestcube*,cubicweb/server/test/data-migractions/cubicweb_*,cubicweb/server/test/data-migractions/migratedapp/cubicweb_*
 
 [pytest]
 python_files = *test_*.py