Ejemplo n.º 1
0
 def unzip_resource_only(self, zip_name, test_only):
     unpack_folder = self.unzip_resource(zip_name)
     out_dir = os.path.join(self.temp_dir, 'test_folder')
     file_utils.make_dir(out_dir)
     for f in test_only:
         shutil.copy(os.path.join(unpack_folder, f), out_dir)
     shutil.rmtree(unpack_folder, ignore_errors=True)
     return out_dir
 def unzip_resource_only(self, zip_name, test_only):
     unpack_folder = self.unzip_resource(zip_name)
     out_dir = os.path.join(self.temp_dir, 'test_folder')
     file_utils.make_dir(out_dir)
     for f in test_only:
         shutil.copy(os.path.join(unpack_folder, f), out_dir)
     shutil.rmtree(unpack_folder, ignore_errors=True)
     return out_dir
 def mock_cdn_upload_file(self, project_file, s3_key, cache_time=600):
     destination_path = os.path.join(self.source_folder, s3_key)
     destination_folder = os.path.dirname(destination_path)
     file_utils.make_dir(destination_folder)
     shutil.copy(project_file, destination_path)
     return
 def test_make_dir(self):
     self.tmp_dir = tempfile.mkdtemp()
     sub_dir = os.path.join(self.tmp_dir, 'subdirectory')
     file_utils.make_dir(sub_dir)
     self.assertTrue(os.path.isdir(sub_dir))
 def mock_cdn_upload_file(self, project_file, s3_key, cache_time=600):
     destination_path = os.path.join(self.source_folder, s3_key)
     destination_folder = os.path.dirname(destination_path)
     file_utils.make_dir(destination_folder)
     shutil.copy(project_file, destination_path)
     return
Ejemplo n.º 6
0
 def test_make_dir(self):
     self.tmp_dir = tempfile.mkdtemp()
     sub_dir = os.path.join(self.tmp_dir, 'subdirectory')
     file_utils.make_dir(sub_dir)
     self.assertTrue(os.path.isdir(sub_dir))