cubicweb/devtools/test/unittest_i18n.py
changeset 12546 465ee7fb16e3
parent 11822 adf0212d1dcc
child 12567 26744ad37953
--- a/cubicweb/devtools/test/unittest_i18n.py	Thu Mar 28 10:04:23 2019 +0100
+++ b/cubicweb/devtools/test/unittest_i18n.py	Thu Mar 28 10:07:02 2019 +0100
@@ -58,7 +58,7 @@
     return msgs
 
 
-TESTCUBE_DIR = osp.join(DATADIR, 'cubes', 'i18ntestcube')
+TESTCUBE_DIR = osp.join(DATADIR, 'libpython', 'cubicweb_i18ntestcube')
 
 
 class cubePotGeneratorTC(TestCase):
@@ -74,17 +74,6 @@
         cubedir = osp.join(DATADIR, 'libpython', 'cubicweb_i18ntestcube')
         self._check(cubedir, env)
 
-    def test_i18ncube_legacy_layout(self):
-        env = os.environ.copy()
-        env['CW_CUBES_PATH'] = osp.join(DATADIR, 'cubes')
-        if 'PYTHONPATH' in env:
-            env['PYTHONPATH'] += os.pathsep
-        else:
-            env['PYTHONPATH'] = ''
-        env['PYTHONPATH'] += DATADIR
-        cubedir = osp.join(DATADIR, 'cubes', 'i18ntestcube')
-        self._check(cubedir, env)
-
     def _check(self, cubedir, env):
         cmd = [sys.executable, '-m', 'cubicweb', 'i18ncube', 'i18ntestcube']
         proc = Popen(cmd, env=env, stdout=PIPE, stderr=STDOUT)
@@ -137,19 +126,14 @@
     @patch('pkg_resources.load_entry_point', return_value=FakeMessageExtractor)
     def test_cube_custom_extractor(self, mock_load_entry_point):
         distname = 'cubicweb_i18ntestcube'  # same for new and legacy layout
-        for cubedir in [
-            osp.join(DATADIR, 'libpython', 'cubicweb_i18ntestcube'),
-            # Legacy cubes.
-            osp.join(DATADIR, 'cubes', 'i18ntestcube'),
-        ]:
-            with self.subTest(cubedir=cubedir):
-                with capture_stdout() as stream:
-                    devctl.update_cube_catalogs(cubedir)
-                self.assertIn(u'no message catalog for cube i18ntestcube',
-                              stream.read())
-                mock_load_entry_point.assert_called_once_with(
-                    distname, 'cubicweb.i18ncube', 'i18ntestcube')
-                mock_load_entry_point.reset_mock()
+        cubedir = osp.join(DATADIR, 'libpython', 'cubicweb_i18ntestcube')
+        with capture_stdout() as stream:
+            devctl.update_cube_catalogs(cubedir)
+        self.assertIn(u'no message catalog for cube i18ntestcube',
+                      stream.read())
+        mock_load_entry_point.assert_called_once_with(
+            distname, 'cubicweb.i18ncube', 'i18ntestcube')
+        mock_load_entry_point.reset_mock()
 
 
 if __name__ == '__main__':