Loading lib/tool_shed/util/repository_util.py +20 −21 Original line number Diff line number Diff line Loading @@ -204,11 +204,10 @@ def create_repository( # Create an admin role for the repository. create_repository_admin_role(app, repository) # Create a temporary repo_path on disk. with tempfile.TemporaryDirectory( repository_path = tempfile.mkdtemp( dir=app.config.file_path, prefix="f{repository.user.username}-{repository.name}", delete=False, ) as repository_path: prefix=f"{repository.user.username}-{repository.name}", ) # Create the local repository. init_repository(repo_path=repository_path) # Create a .hg/hgrc file for the local repository. Loading test/unit/shed_unit/test_shed_index.py +5 −1 Original line number Diff line number Diff line Loading @@ -36,10 +36,11 @@ def community_file_dir(): @pytest.fixture() def community_file_structure(community_file_dir): community = namedtuple("community", "file_path hgweb_config_dir dburi") community = namedtuple("community", "file_path hgweb_config_dir hgweb_repos_prefix dburi") return community( file_path=os.path.join(community_file_dir, "database", "community_files"), hgweb_config_dir=community_file_dir, hgweb_repos_prefix="repos/", dburi="sqlite:///%s" % os.path.join(community_file_dir, "database", "community.sqlite"), ) Loading @@ -49,6 +50,7 @@ def test_build_index(whoosh_index_dir, community_file_structure): whoosh_index_dir, community_file_structure.file_path, community_file_structure.hgweb_config_dir, community_file_structure.hgweb_repo_prefix, community_file_structure.dburi, ) assert repos_indexed == 1 Loading @@ -59,6 +61,7 @@ def test_build_index(whoosh_index_dir, community_file_structure): whoosh_index_dir, community_file_structure.file_path, community_file_structure.hgweb_config_dir, community_file_structure.hgweb_repo_prefix, community_file_structure.dburi, ) assert repos_indexed == 0 Loading @@ -74,6 +77,7 @@ def test_build_index(whoosh_index_dir, community_file_structure): whoosh_index_dir, community_file_structure.file_path, community_file_structure.hgweb_config_dir, community_file_structure.hgweb_repo_prefix, community_file_structure.dburi, ) assert repos_indexed == 1 Loading Loading
lib/tool_shed/util/repository_util.py +20 −21 Original line number Diff line number Diff line Loading @@ -204,11 +204,10 @@ def create_repository( # Create an admin role for the repository. create_repository_admin_role(app, repository) # Create a temporary repo_path on disk. with tempfile.TemporaryDirectory( repository_path = tempfile.mkdtemp( dir=app.config.file_path, prefix="f{repository.user.username}-{repository.name}", delete=False, ) as repository_path: prefix=f"{repository.user.username}-{repository.name}", ) # Create the local repository. init_repository(repo_path=repository_path) # Create a .hg/hgrc file for the local repository. Loading
test/unit/shed_unit/test_shed_index.py +5 −1 Original line number Diff line number Diff line Loading @@ -36,10 +36,11 @@ def community_file_dir(): @pytest.fixture() def community_file_structure(community_file_dir): community = namedtuple("community", "file_path hgweb_config_dir dburi") community = namedtuple("community", "file_path hgweb_config_dir hgweb_repos_prefix dburi") return community( file_path=os.path.join(community_file_dir, "database", "community_files"), hgweb_config_dir=community_file_dir, hgweb_repos_prefix="repos/", dburi="sqlite:///%s" % os.path.join(community_file_dir, "database", "community.sqlite"), ) Loading @@ -49,6 +50,7 @@ def test_build_index(whoosh_index_dir, community_file_structure): whoosh_index_dir, community_file_structure.file_path, community_file_structure.hgweb_config_dir, community_file_structure.hgweb_repo_prefix, community_file_structure.dburi, ) assert repos_indexed == 1 Loading @@ -59,6 +61,7 @@ def test_build_index(whoosh_index_dir, community_file_structure): whoosh_index_dir, community_file_structure.file_path, community_file_structure.hgweb_config_dir, community_file_structure.hgweb_repo_prefix, community_file_structure.dburi, ) assert repos_indexed == 0 Loading @@ -74,6 +77,7 @@ def test_build_index(whoosh_index_dir, community_file_structure): whoosh_index_dir, community_file_structure.file_path, community_file_structure.hgweb_config_dir, community_file_structure.hgweb_repo_prefix, community_file_structure.dburi, ) assert repos_indexed == 1 Loading