def test_process_document(self, mock_open, makedir): #/tmp/col1/incoming/11/111111/asd2/0.1 modulepath = "compmusic.extractors.Test2Extractor" instance = Test2Extractor() self.get_m.return_value = instance mod = jobs.create_module(modulepath, [self.col1.pk]) self.assertEqual(len(models.Module.objects.all()), 1) jobs.run_module_on_collection(self.col1.pk, mod.pk) self.assertEqual(len(self.doc1.derivedfiles.all()), 1)
def test_process_document(self, mock_open, makedir): # /tmp/col1/incoming/11/111111/asd2/0.1 modulepath = "compmusic.extractors.Test2Extractor" instance = Test2Extractor() self.get_m.return_value = instance mod = jobs.create_module(modulepath, [self.col1.pk]) self.assertEqual(len(models.Module.objects.all()), 1) jobs.run_module_on_collection(self.col1.pk, mod.pk) self.assertEqual(len(self.doc1.derivedfiles.all()), 1)
def test_process_document(self, log): modulepath = "compmusic.extractors.TestExtractor" instance = TestExtractor() self.get_m.return_value = instance mod = jobs.create_module(modulepath, [self.col1.pk]) self.assertEqual(len(models.Module.objects.all()), 1) jobs.run_module_on_collection(self.col1.pk, mod.pk) doc = models.Document.objects.get(pk=self.col1.pk) self.assertEqual(len(doc.derivedfiles.all()), 1)