def test_one_file_only(self): # if a zip file contains more than one file, that's an error proc = UnzipProcessor() self.result_path, metadata = proc.process( self.zipfile2_path, {'error': False}) assert metadata['error'] is True assert self.result_path is None
def test_one_file_only(self, workdir, samples_dir): # if a zip file contains more than one file, that's an error proc = UnzipProcessor() result_path, metadata = proc.process( str(samples_dir / "sample1.zip"), {'error': False}) assert metadata['error'] is True assert result_path is None
def test_one_file_only(self, workdir, samples_dir): # if a zip file contains more than one file, that's an error proc = UnzipProcessor() result_path, metadata = proc.process(str(samples_dir / "sample1.zip"), {'error': False}) assert metadata['error'] is True assert result_path is None
def test_unsupported_extension(self, workdir): # if the given file has unsupported filenames extension, # it is returned unchanged. proc = UnzipProcessor() input_path = str(workdir / "src" / "sample.txt") result_path, metadata = proc.process(input_path, {'error': False}) assert metadata['error'] is False assert result_path == input_path
def test_simple(self, workdir, samples_dir): proc = UnzipProcessor() resultpath, metadata = proc.process( str(samples_dir / "sample2.zip"), {}) assert resultpath.endswith('simple.txt')
def test_simple(self): proc = UnzipProcessor() self.result_path, metadata = proc.process(self.zipfile_path, {}) assert self.result_path.endswith('simple.txt')
def test_simple(self, workdir, samples_dir): proc = UnzipProcessor() resultpath, metadata = proc.process(str(samples_dir / "sample2.zip"), {}) assert resultpath.endswith('simple.txt')