Skip to content

Commit

Permalink
adjust test setup to use actually existing files
Browse files Browse the repository at this point in the history
  • Loading branch information
muellert committed Dec 23, 2012
1 parent 62e0398 commit 2e2c0f4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions on/video/tests/corrupted1.metadata
@@ -0,0 +1 @@
invalidheader: invalidvalue
1 change: 1 addition & 0 deletions on/video/tests/corrupted2.metadata
@@ -0,0 +1 @@
thumbnail: nail
7 changes: 3 additions & 4 deletions on/video/tests/test_functional.py
Expand Up @@ -40,7 +40,7 @@ def setUp(self):
# generate a set of mockup files:
self.td = tempfile.mkdtemp(prefix = "on.video-tests.")
files_to_copy = [ 'sample_video_%d.metadata' % i for i in range(1, 8) ]
otherfiles = [ 'Vincent_Untz.metadata', 'corrupted.metadata', 'thumb.png' ]
otherfiles = [ 'Vincent_Untz.metadata', 'corrupted1.metadata', 'corrupted2.metadata', 'thumb.png' ]
files_to_copy = files_to_copy + otherfiles
for f in files_to_copy:
sampledata = os.path.join(os.path.dirname(__file__), f)
Expand Down Expand Up @@ -400,9 +400,8 @@ def test_video_format_thingy(self):
def test_rejection_of_corrupted_files(self):
from on.video.video import parseMetadataFileContents, fixupConfig, getMetaDataFileLines
settings = fixupConfig()
lines = getMetaDataFileLines(settings.fspath, 'corrupted')
vo = parseMetadataFileContents(lines, settings.urlbase, settings.fspath, 'corrupted')
#import pdb; pdb.set_trace()
lines = getMetaDataFileLines(settings.fspath, 'corrupted1')
vo = parseMetadataFileContents(lines, settings.urlbase, settings.fspath, 'corrupted1')
self.failUnless(vo.thumbnailurl == '/++resource++on.video/invalidmetafile.png')


0 comments on commit 2e2c0f4

Please sign in to comment.