예제 #1
0
 def test_getPhysicalPath(self):
     desired_id = os.path.splitext(os.path.split(self.TEMPFILENAME)[-1])[0]
     desired_path = (desired_id,)
     f = open(self.TEMPFILENAME, 'wb')
     f.write(b'Boring')
     f.close()
     pt = PageTemplateFile(self.TEMPFILENAME)
     pt_path = pt.getPhysicalPath()
     self.assertEqual(
         pt_path, desired_path,
         f'getPhysicalPath() returned {desired_path!r}.'
         f' Expecting {pt_path!r}'
     )
예제 #2
0
파일: test_ptfile.py 프로젝트: dhavlik/Zope
 def test_getPhysicalPath(self):
     desired_id = os.path.splitext(os.path.split(self.TEMPFILENAME)[-1])[0]
     desired_path = (desired_id,)
     f = open(self.TEMPFILENAME, 'wb')
     f.write(b'Boring')
     f.close()
     pt = PageTemplateFile(self.TEMPFILENAME)
     pt_path = pt.getPhysicalPath()
     self.assertEqual(
         pt_path, desired_path,
         'getPhysicalPath() returned %r. Expecting %r' % (
             desired_path, pt_path,
         )
     )
예제 #3
0
 def test_getPhysicalPath(self):
     desired_id = os.path.splitext(os.path.split(self.TEMPFILENAME)[-1])[0]
     desired_path = (desired_id, )
     f = open(self.TEMPFILENAME, 'w')
     print >> f, 'Boring'
     f.close()
     pt = PageTemplateFile(self.TEMPFILENAME)
     pt_path = pt.getPhysicalPath()
     self.assertEqual(
         pt_path, desired_path,
         'getPhysicalPath() returned %r. Expecting %r' % (
             desired_path,
             pt_path,
         ))
예제 #4
0
 def test_getPhysicalPath(self):
     desired_id = os.path.splitext(os.path.split(self.TEMPFILENAME)[-1])[0]
     desired_path = (desired_id,)
     f = open(self.TEMPFILENAME, 'w')
     print >> f, 'Boring'
     f.close()
     pt = PageTemplateFile(self.TEMPFILENAME)
     pt_path = pt.getPhysicalPath()
     self.failUnlessEqual(
             pt_path, desired_path,
             'getPhysicalPath() returned %r. Expecting %r' % (
                 desired_path, pt_path,
                 )
             )