Ejemplo n.º 1
0
def test_check_pypi_name(fake_repo, pypi_name):
    setup_py = get_file_content(FAKE_REPO_ROOT / fake_repo / "setup.py")
    setup_cfg = get_file_content(FAKE_REPO_ROOT / fake_repo / "setup.cfg")
    all_results = {module_dict_key: {}}
    check_pypi_name(setup_py, setup_cfg, all_results)
    if pypi_name is not None:
        assert all_results[module_dict_key]["pypi_name"] == pypi_name
    else:
        assert "pypi_name" not in all_results[module_dict_key]
Ejemplo n.º 2
0
def fixture_setup_py(repo_path):
    """Fixture containing the text content of setup.py"""
    full_path = os.path.join(repo_path, "setup.py")
    return get_file_content(full_path)
Ejemplo n.º 3
0
def fixture_makefile(repo_path):
    """Fixture containing the text content of Makefile"""
    full_path = os.path.join(repo_path, "Makefile")
    return get_file_content(full_path)
Ejemplo n.º 4
0
def fixture_tox_ini(repo_path):
    """Fixture containing the text content of tox.ini"""
    full_path = os.path.join(repo_path, "tox.ini")
    return get_file_content(full_path)
Ejemplo n.º 5
0
def fixture_tox_ini(repo_path):
    """Fixture containing the text content of tox.ini"""
    # TODO(jinder): make below work with inputs with both "/" at end and not
    full_path = os.path.join(repo_path, "tox.ini")
    return get_file_content(full_path)
Ejemplo n.º 6
0
def fixture_travis_yaml(repo_path):
    """Fixture containing the text content of travis.yml"""
    full_path = os.path.join(repo_path, ".travis.yml")
    return get_file_content(full_path)
Ejemplo n.º 7
0
def fixture_openedx_yaml(repo_path):
    """Fixture containing the text content of openedx.yaml"""
    full_path = os.path.join(repo_path, "openedx.yaml")
    return get_file_content(full_path)
Ejemplo n.º 8
0
def file_exists(repo_path, file_name):
    full_path = os.path.join(repo_path, file_name)
    return bool(get_file_content(full_path))