'Try importing a known good library archive under either branch setting.
The branch setting should have no effect on library import.'

@ddt.data(ModuleStoreEnum.Branch.draft_preferred, ModuleStoreEnum.Branch.published_only)
def test_library_import_branch_settings(self, branch_setting):

    with self.store.branch_setting(branch_setting):
        library = LibraryFactory.create(modulestore=self.store)
        lib_key = library.location.library_key
        extract_dir = path(tempfile.mkdtemp(dir=settings.DATA_DIR))
        extract_dir_relative = path.relpath(extract_dir, settings.DATA_DIR)
        try:
            with tarfile.open(((path(TEST_DATA_DIR) / 'imports') / 'library.HhJfPD.tar.gz')) as tar:
                safetar_extractall(tar, extract_dir)
            import_library_from_xml(self.store, self.user.id, settings.GITHUB_REPO_ROOT, [(extract_dir_relative / 'library')], load_error_modules=False, static_content_store=contentstore(), target_id=lib_key)
        finally:
            shutil.rmtree(extract_dir)
