コード例 #1
0
 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')
コード例 #2
0
 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')
コード例 #3
0
 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')
コード例 #4
0
 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')