示例#1
0
def test_envelop_with_a_real_environment():
    # Given that I have an environment
    env = Environment()

    # When I set a variable in that environment
    env.set('yo-dawg', 'I heard you like variables')

    # Then I see that it was set in the actual environment
    assert os.environ.get('yo-dawg') == 'I heard you like variables'
示例#2
0
def test_envelop_environment_set():
    # Given that I have an empty environment
    env = Environment()

    # When I set something
    env.set('myvar', 'myvalue')

    # I'll be able to get it properly
    assert ('myvar', 'myvalue') in env.items()
示例#3
0
def test_envelop_environment_get_uri():
    # Given that I have an environment with a variable containing a uri
    env = Environment()
    env.set('githubpage', 'https://*****:*****@github.com/yipit/envelop')

    # When I try to get the value as a Uri
    uri = env.get_uri('githubpage')

    # Then I see things working
    assert uri.scheme == 'https'
    assert uri.host == 'github.com'
    assert uri.port is None
    assert uri.user == 'clarete'
    assert uri.password == 'passwd!!'
    assert uri.path == '/yipit/envelop'
    assert uri.relative_path == 'yipit/envelop'