'If environment variables are specified when creating a container,
those variables are available in the container\'s environment.'

@require_cluster(1, require_container_agent=True)
def test_create_container_with_environment(self, cluster):

    environment = {u'XBLOO': u'YBLAH', u'ZBLOO': u'ZEBRA'}
    d = create_python_container(self, cluster, {u'ports': [{u'internal': 8080, u'external': 8080}], u'node_uuid': cluster.nodes[0].uuid, u'environment': environment}, SCRIPTS.child('envhttp.py'))
    def checked(_):
        host = cluster.nodes[0].public_address
        d = query_http_server(host, 8080)
        d.addCallback((lambda data: dict(loads(data))))
        return d
    d.addCallback(checked)
    d.addCallback((lambda response: self.assertDictContainsSubset(environment, response)))
    return d
