def test_fix_settings_fspath(self): """See whether the file system path is properly reset. """ from on.video.video import fixupConfig oldsettings = self.settings self.settings.fspath = u'/nosuchfileordirectory' fixupConfig() self.failUnless(self.settings.fspath == u'/tmp')
def test_fix_settings_url(self): """See whether the URL is properly fixed. """ from on.video.video import fixupConfig oldsettings = self.settings self.settings.urlbase = 'http://nohost' fixupConfig() self.failUnless(self.settings.urlbase.endswith('/'))
def test_rejection_of_corrupted_files(self): from on.video.video import parseMetadataFileContents, fixupConfig, getMetaDataFileLines settings = fixupConfig() lines = getMetaDataFileLines(settings.fspath, 'corrupted1') vo = parseMetadataFileContents(lines, settings.urlbase, settings.fspath, 'corrupted1') self.failUnless(vo.thumbnailurl == '/++resource++on.video/invalidmetafile.png')