예제 #1
0
def test_validate_credentials_raises_user_error_on_unauthorized(pypi_chishop,
                                                                workspace):
    config = pypi_chishop.get_rc()
    config.set('server-login', 'password', 'hunter2')
    workspace.create_pypirc(config)
    pypirc = PyPiRc(os.path.join(workspace.workspace, '.pypirc'))
    with pytest.raises(UserError) as exc:
        pypirc.validate_credentials(pypi_chishop.uri)
    assert exc.value.msg.startswith(UserError('Invalid PyPi credentials',
                                              pypi_chishop.uri, '').msg)
예제 #2
0
def test_validate_credentials(pypi_chishop, workspace):
    workspace.create_pypirc(pypi_chishop.get_rc())
    pypirc = PyPiRc(os.path.join(workspace.workspace, '.pypirc'))
    pypirc.validate_credentials(pypi_chishop.uri)