[test] don't rely on a stable ordering for appobject_path
authorJulien Cristau <julien.cristau@logilab.fr>
Thu, 12 Feb 2015 18:13:00 +0100
changeset 10239 495efb844048
parent 10238 725005e8346d
child 10240 6ec03928257f
[test] don't rely on a stable ordering for appobject_path Fixes test under python -R. Related to #4959402.
test/unittest_cwconfig.py
--- a/test/unittest_cwconfig.py	Fri Mar 13 15:30:01 2015 +0100
+++ b/test/unittest_cwconfig.py	Thu Feb 12 18:13:00 2015 +0100
@@ -104,11 +104,14 @@
     def test_appobjects_path(self):
         self.config.__class__.CUBES_PATH = [CUSTOM_CUBES_DIR]
         self.config.adjust_sys_path()
-        self.assertEqual([unabsolutize(p) for p in self.config.appobjects_path()],
-                          ['entities', 'web/views', 'sobjects', 'hooks',
-                           'file/entities', 'file/views.py', 'file/hooks',
-                           'email/entities.py', 'email/views', 'email/hooks.py',
-                           'test/data/entities.py', 'test/data/views.py'])
+        path = [unabsolutize(p) for p in self.config.appobjects_path()]
+        self.assertEqual(path[0], 'entities')
+        self.assertCountEqual(path[1:4], ['web/views', 'sobjects', 'hooks'])
+        self.assertEqual(path[4], 'file/entities')
+        self.assertCountEqual(path[5:7], ['file/views.py', 'file/hooks'])
+        self.assertEqual(path[7], 'email/entities.py')
+        self.assertCountEqual(path[8:10], ['email/views', 'email/hooks.py'])
+        self.assertEqual(path[10:], ['test/data/entities.py', 'test/data/views.py'])
 
     def test_cubes_path(self):
         # make sure we don't import the email cube, but the stdlib email package