コード例 #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
コード例 #2
0
def mocked_repo(mocker):
    with mocker:
        return Repo("https://github.com/fair-software/badge",
                    config_file=".howfairis-custom-config.yml")
コード例 #3
0
def mocked_repo(mocker):
    with mocker:
        return Repo("https://github.com/fair-software/badge")
コード例 #4
0
def mocked_config(mocker):
    with mocker:
        repo = Repo("https://gitlab.com/jspaaks/badge-test")
        return Config(repo)
コード例 #5
0
def mocked_repo(mocker):
    with mocker:
        return Repo("https://github.com/fair-software/badge", branch="b3f90ec9c2b1be604f482c2d9e46a9aeca3ee45a")
コード例 #6
0
ファイル: test_repo.py プロジェクト: PabRod/howfairis
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'
コード例 #7
0
def mocked_repo(mocker):
    with mocker:
        return Repo("https://gitlab.com/jspaaks/badge-test")
コード例 #8
0
def mocked_config(mocker):
    with mocker:
        repo = Repo("https://github.com/fair-software/badge")
        return Config(repo)
コード例 #9
0
def mocked_repo(mocker):
    with mocker:
        return Repo("https://github.com/fair-software/badge", branch="develop")