Unverified Commit 2e8c0df8 authored by mvdbeek's avatar mvdbeek
Browse files

Test and lint fixes

parent 4978d647
Loading
Loading
Loading
Loading
+20 −21
Original line number Diff line number Diff line
@@ -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.
+5 −1
Original line number Diff line number Diff line
@@ -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"),
    )

@@ -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
@@ -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
@@ -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