Esempio n. 1
0
def test_get_repository_keyring():
    with modified_env({'FLIT_PASSWORD': None}), \
            _fake_keyring('tops3cret'):
        repo = upload.get_repository(pypirc_path=io.StringIO(pypirc2))

    assert repo['username'] == 'fred'
    assert repo['password'] == 'tops3cret'
Esempio n. 2
0
def test_get_repository_env():
    with modified_env({
        'FLIT_INDEX_URL': 'https://pypi.example.com',
        'FLIT_USERNAME': '******',
        'FLIT_PASSWORD': '******',  # Also not a real password
    }):
        repo = upload.get_repository(cfg_file=io.StringIO(pypirc1))
        # Because we haven't specified a repo name, environment variables should
        # have higher priority than the config file.
        assert repo['url'] == 'https://pypi.example.com'
        assert repo['username'] == 'alice'
        assert repo['password'] == 'p4ssword'
Esempio n. 3
0
def test_get_repository():
    with temp_pypirc(pypirc1) as pypirc:
        repo = upload.get_repository(pypirc_path=pypirc)
        assert repo['url'] == upload.PYPI
        assert repo['username'] == 'fred'
        assert repo['password'] == 's3cret'
Esempio n. 4
0
def test_get_repository():
    repo = upload.get_repository(cfg_file=io.StringIO(pypirc1))
    assert repo['url'] == upload.PYPI
    assert repo['username'] == 'fred'
    assert repo['password'] == 's3cret'