Beispiel #1
0
 def test_invalid_mp3_fails(self, invalid_audio_file):
     node = AudioNode('audio-src-id',
                      "Document",
                      licenses.PUBLIC_DOMAIN,
                      thumbnail=None)
     node.add_file(invalid_audio_file)
     config.THUMBNAILS = True
     filenames = node.process_files()
Beispiel #2
0
 def test_generate_thumbnail_from_audio(self, audio_file):
     node = AudioNode('audio-src-id',
                      "Audio",
                      licenses.PUBLIC_DOMAIN,
                      thumbnail=None)
     node.add_file(audio_file)
     config.THUMBNAILS = True
     filenames = node.process_files()
     assert len(filenames) == 2, 'expected two filenames'
     self.check_has_thumbnail(node)
Beispiel #3
0
 def test_non_existent_mp3_fails(self):
     node = AudioNode('audio-src-id',
                      "Document",
                      licenses.PUBLIC_DOMAIN,
                      thumbnail=None)
     non_existent_path = 'does/not/exist.mp3'
     document_file = AudioFile(non_existent_path, language='en')
     node.add_file(document_file)
     config.THUMBNAILS = True
     filenames = node.process_files()
     assert filenames == [None], 'expected one None (the non existent mp3)'
     assert len(config.FAILED_FILES) == 1, 'expected one failed file'