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))
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 ) )
def test_pathtrans( self ): localpath = thumbnails.getLocalThumbPath( self.testnode.image ) self.assertTrue( os.path.isfile( localpath ) )