Esempio n. 1
0
    def _makeOne(self, id, filename):

        from Products.CMFCore.FSImage import FSImage
        from Products.CMFCore.tests.test_DirectoryView import skin_path_name
        import os.path

        return FSImage(id, os.path.join(skin_path_name, filename))
    def test_FSObjectLastModified_FSImage(self):
        from Products.CMFCore.FSImage import FSImage

        dummy = FSImage('dummy', __file__)  # not really an image, but anyway
        modtime = float(os.path.getmtime(__file__))
        mod = datetime.datetime.fromtimestamp(modtime, tzlocal())
        # different filesystems seem to handle datetime differently. some use microseconds
        # and others don't so to make jenkins happy lets omit the microseconds factor
        format = "%y%m%d%H%M%s"
        self.assertEqual(mod.strftime(format),
                         ILastModified(dummy)().strftime(format))
Esempio n. 3
0
    def _makeOne(self, id, filename):

        from Products.CMFCore.FSImage import FSImage

        return FSImage(id, path_join(self.skin_path_name, filename))