コード例 #1
0
    def testCreateTestImage(self):
        filename = "chuck_norris.png"
        staticFiles = config.Configuration().get(config.CONF_STATIC_FILES)
        testfile = os.path.join(staticFiles, "testing", "images", filename)
        daurl = thumbnails.createTestThumbnailPath(testfile)

        localPath = thumbnails.getLocalThumbPath(daurl)
        self.assertTrue(os.path.isfile(localPath))
        self.assertTrue(
            daurl.startswith(config.Configuration().get(
                config.CONF_SHOTGUN_URL)))
        self.assertTrue(daurl.endswith(filename))

        shutil.rmtree(os.path.dirname(localPath))
コード例 #2
0
    def testCreateTestImage( self ):
        filename = "chuck_norris.png"
        staticFiles = config.Configuration().get( config.CONF_STATIC_FILES )
        testfile = os.path.join( staticFiles,
                                 "testing",
                                 "images",
                                 filename )
        daurl = thumbnails.createTestThumbnailPath( testfile )

        localPath = thumbnails.getLocalThumbPath( daurl )
        self.assertTrue( os.path.isfile( localPath ) )
        self.assertTrue( daurl.startswith( config.Configuration().get( config.CONF_SHOTGUN_URL ) ) )
        self.assertTrue( daurl.endswith( filename ) )

        shutil.rmtree( os.path.dirname( localPath ) )
コード例 #3
0
 def test_pathtrans( self ):
     localpath = thumbnails.getLocalThumbPath( self.testnode.image )
     self.assertTrue( os.path.isfile( localpath ) )