def test_milieu_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 os.environ.get('yo-dawg').should.equal('I heard you like variables')
def test_milieu_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 env.items().should.contain(('myvar', 'myvalue'))
def test_milieu_environment_get_uri(): # Given that I have an environment with a variable containing a uri env = Environment() env.set('githubpage', 'https://*****:*****@github.com/yipit/milieu') # When I try to get the value as a Uri uri = env.get_uri('githubpage') # Then I see things working uri.scheme.should.equal('https') uri.host.should.equal('github.com') uri.port.should.equal(None) uri.user.should.equal('clarete') uri.password.should.equal('passwd!!') uri.path.should.equal('/yipit/milieu') uri.relative_path.should.equal('yipit/milieu')