# HG changeset patch # User David Douard # Date 1417131571 -3600 # Node ID 4bc099f2a089f8452c68d0b4cbb9f739c6a9412f # Parent 5244592cb225237c0df294937f4f6d1f990e9c34 [test] make unittest_webconfig independant of CWD if apphome is unset in ApptestConfiguration constructor, this later looks for a 'data' directory in CWD, making this test runnable only from web/test (and pytest do chdir before executing tests, so we did not noticed this problem). diff -r 5244592cb225 -r 4bc099f2a089 web/test/unittest_webconfig.py --- a/web/test/unittest_webconfig.py Fri Nov 28 11:51:36 2014 +0100 +++ b/web/test/unittest_webconfig.py Fri Nov 28 00:39:31 2014 +0100 @@ -25,7 +25,9 @@ class WebconfigTC(TestCase): def setUp(self): - self.config = ApptestConfiguration('data') + # need explicit None if dirname(__file__) is empty, see + # ApptestConfiguration.__init__ + self.config = ApptestConfiguration('data', apphome=os.path.dirname(__file__) or None) self.config._cubes = ['file'] self.config.load_configuration() @@ -42,7 +44,11 @@ rname = self.config.uiprops['FILE_ICON'].replace(self.config.datadir_url, '') self.assertIn('file', self.config.locate_resource(rname)[0].split(os.sep)) cubicwebcsspath = self.config.locate_resource('cubicweb.css')[0].split(os.sep) - self.assertTrue('web' in cubicwebcsspath or 'shared' in cubicwebcsspath) # 'shared' if tests under apycot + + # 'shared' if tests under apycot + self.assertTrue('web' in cubicwebcsspath or 'shared' in cubicwebcsspath, + 'neither "web" nor "shared" found in cubicwebcsspath (%s)' + % cubicwebcsspath) def test_sign_text(self): signature = self.config.sign_text(u'hôp')