def testURL(self): request = TestRequest() request._vh_root = support.site path = os.path.join(test_directory, 'testfiles') files = DirectoryResourceFactory(path, checker, 'test_files')(request) files.__parent__ = support.site file = files['test.gif'] self.assertEqual(file(), 'http://127.0.0.1/@@/test_files/test.gif')
def testURL3Level(self): request = TestRequest() request._vh_root = support.site ob.__parent__ = support.site ob.__name__ = 'ob' path = os.path.join(test_directory, 'testfiles') files = DirectoryResourceFactory(path, checker, 'test_files')(request) files.__parent__ = ob file = files['test.gif'] self.assertEqual(file(), 'http://127.0.0.1/@@/test_files/test.gif') subdir = files['subdir'] self.assertTrue(proxy.isinstance(subdir, DirectoryResource)) file = subdir['test.gif'] self.assertEqual(file(), 'http://127.0.0.1/@@/test_files/subdir/test.gif')