Пример #1
0
def test_config_from_env_project():
    def simple_getenv(key):
        if key == 'OSF_PROJECT':
            return None

    with patch('osfclient.cli.os.getenv', side_effect=simple_getenv):
        config = cli.config_from_env({'project': 'theproject'})

    assert config == {'project': 'theproject'}
Пример #2
0
def test_config_from_env_username():
    def simple_getenv(key):
        if key == 'OSF_USERNAME':
            return None

    with patch('osfclient.cli.os.getenv', side_effect=simple_getenv):
        config = cli.config_from_env({'username': '******'})

    assert config == {'username': '******'}