Exemplo n.º 1
0
def badghurl_checker(requests_mock: Mocker):
    requests_mock.get(
        'https://raw.githubusercontent.com/fair-software/does-not-exist/main/.howfairis.yml',
        status_code=404)
    requests_mock.get(
        'https://raw.githubusercontent.com/fair-software/does-not-exist/main/.howfairis.yml',
        status_code=404)
    requests_mock.get(
        'https://raw.githubusercontent.com/fair-software/does-not-exist/main/README.md',
        status_code=404)
    requests_mock.get(
        'https://raw.githubusercontent.com/fair-software/does-not-exist/main/README.rst',
        status_code=404)
    requests_mock.get(
        'https://api.github.com/repos/fair-software/does-not-exist',
        status_code=404)
    requests_mock.get(
        'https://api.github.com/repos/fair-software/does-not-exist/license',
        status_code=404)
    requests_mock.get('https://github.com/fair-software/does-not-exist',
                      status_code=404)
    requests_mock.get(
        'https://raw.githubusercontent.com/fair-software/does-not-exist/main/CITATION',
        status_code=404)
    requests_mock.get(
        'https://raw.githubusercontent.com/fair-software/does-not-exist/main/CITATION.cff',
        status_code=404)
    requests_mock.get(
        'https://raw.githubusercontent.com/fair-software/does-not-exist/main/codemeta.json',
        status_code=404)
    requests_mock.get(
        'https://raw.githubusercontent.com/fair-software/does-not-exist/main/.zenodo.json',
        status_code=404)

    repo = Repo('https://github.com/fair-software/does-not-exist')
    config = Config(repo)
    checker = Checker(config, repo)
    return checker
Exemplo n.º 2
0
def mocked_repo(mocker):
    with mocker:
        return Repo("https://github.com/fair-software/badge",
                    config_file=".howfairis-custom-config.yml")
Exemplo n.º 3
0
def mocked_repo(mocker):
    with mocker:
        return Repo("https://github.com/fair-software/badge")
Exemplo n.º 4
0
def mocked_config(mocker):
    with mocker:
        repo = Repo("https://gitlab.com/jspaaks/badge-test")
        return Config(repo)
Exemplo n.º 5
0
def mocked_repo(mocker):
    with mocker:
        return Repo("https://github.com/fair-software/badge", branch="b3f90ec9c2b1be604f482c2d9e46a9aeca3ee45a")
Exemplo n.º 6
0
def test_github_platform(requests_mock: Mocker):
    requests_mock.get('https://api.github.com/repos/fair-software/howfairis',
                      json={'default_branch': 'master'})

    repo = Repo('https://github.com/fair-software/howfairis')
    assert repo.platform == Platform.GITHUB, 'platform not GitHub'
Exemplo n.º 7
0
def mocked_repo(mocker):
    with mocker:
        return Repo("https://gitlab.com/jspaaks/badge-test")
Exemplo n.º 8
0
def mocked_config(mocker):
    with mocker:
        repo = Repo("https://github.com/fair-software/badge")
        return Config(repo)
def mocked_repo(mocker):
    with mocker:
        return Repo("https://github.com/fair-software/badge", branch="develop")