[test/web] add a test for css generation file permission problem (related to #17143773) 3.26
authorDavid Douard <david.douard@logilab.fr>
Thu, 19 Apr 2018 12:45:24 +0200
branch3.26
changeset 12287 547bb96ea2a8
parent 12286 90ab73afe766
child 12288 2c582a242b66
[test/web] add a test for css generation file permission problem (related to #17143773)
cubicweb/web/test/unittest_propertysheet.py
--- a/cubicweb/web/test/unittest_propertysheet.py	Thu Apr 19 15:05:55 2018 +0200
+++ b/cubicweb/web/test/unittest_propertysheet.py	Thu Apr 19 12:45:24 2018 +0200
@@ -58,6 +58,13 @@
         os.utime(self.data('pouet.css'), None)
         self.assertFalse(ps.need_reload())
 
+    def test_chmod(self):
+        ps = PropertySheet(self.cachedir, datadir_url='http://cwtest.com')
+        ps.load(self.data('sheet1.py'))
+        rdir = ps.process_resource(DATADIR, 'pouet.css')
+        mode = os.stat(join(rdir, 'pouet.css')).st_mode
+        self.assertEqual(('%o' % mode)[-4:], '0644')
+
 
 if __name__ == '__main__':
     main()