示例#1
0
def test_default_auth_bad():
    from members import github_repo as repo

    # DEFAULT AUTH should be 'anonymous'; no user/pass required
    # collaborators SHOULD require auth
    target = 'collaborators'
    try:
        repo.extract(repo_url=TEST_REPO, target=target)
    # FIXME: check for specific github exception too.
    except Exception as e:
        print('EXPECTED GITHUB EXCEPTION, got {}. IGNORING!'.format(e))
    else:
        raise RuntimeError("EXPECTED EXCEPTION, didn't get one though... oops")
示例#2
0
def test_default_auth_good():
    from members import github_repo as repo

    # DEFAULT AUTH should be 'anonymous'; no user/pass required

    # assignees should not require authenticated user to call
    target = 'assignees'
    users = repo.extract(repo_url=TEST_REPO, target=target)

    # see: https://github.com/maxtepkeev/instructions
    # see: http://bit.ly/maxtepkeev_instructions_eupy15
    result = commands.count(datatypes.string).inside(users)
    if not result >= 1:
        raise RuntimeError(
            "Expeted more than one assignee, got {}".format(result))