示例#1
0
 def test_get_static_file01(self):
     """Lookup static file from built-in themes"""
     host = Host(self.test_root)
     self.assertEqual(
         os.path.normcase(host.get_static_file('index.css')),
         os.path.normcase(
             os.path.abspath(
                 os.path.join(wsb_host.__file__, '..', '..', 'themes',
                              'default', 'static', 'index.css'))))
    def test_get_static_file03(self):
        """Lookup static file from local themes"""
        other_static = os.path.join(self.test_root, WSB_DIR, 'themes', 'default', 'static', 'test.txt')
        os.makedirs(os.path.dirname(other_static))
        with open(other_static, 'w') as fh:
            pass

        host = Host(self.test_root)
        self.assertEqual(host.get_static_file('test.txt'), other_static)