Exemplo n.º 1
0
 def test_extract_archive_fails_on_dir(self):
     with self.assertRaises(ExtractError) as ctx:
         Extract.extract_archive(archive_path=TestExtract.temp_dir,
                                 out_dir_path=TestExtract.temp_dir)
     self.assertTrue(
         str(ctx.exception).startswith("Path is not a valid archive"))
Exemplo n.º 2
0
 def test_extract_archive_rar_split(self):
     Extract.extract_archive(archive_path=TestExtract.ar_rar_split_p1,
                             out_dir_path=TestExtract.temp_dir)
     self._assert_extracted_files(TestExtract.temp_dir)
Exemplo n.º 3
0
 def test_extract_archive_tar_gz(self):
     Extract.extract_archive(archive_path=TestExtract.ar_tar_gz,
                             out_dir_path=TestExtract.temp_dir)
     self._assert_extracted_files(TestExtract.temp_dir)
Exemplo n.º 4
0
 def test_extract_archive_creates_sub_directories(self):
     out_path = os.path.join(TestExtract.temp_dir, "bunch", "of", "sub",
                             "dir")
     Extract.extract_archive(archive_path=TestExtract.ar_rar,
                             out_dir_path=out_path)
     self._assert_extracted_files(out_path)