'``Configuration.model_from_configuration`` returns a
``Deployment`` object with ``Nodes`` for each supplied node key.'

def test_model_from_configuration(self):

    application_configuration = {u'version': 1, u'applications': {u'mysql-hybridcluster': {u'image': u'flocker/mysql:v1.2.3'}, u'site-hybridcluster': {u'image': u'flocker/nginx:v1.2.3'}}}
    deployment_configuration = {u'version': 1, u'nodes': {u'172.16.255.250': [u'mysql-hybridcluster'], u'172.16.255.251': [u'site-hybridcluster']}}
    node1_uuid = uuid4()
    node2_uuid = uuid4()
    config = FlockerConfiguration(application_configuration)
    applications = config.applications()
    result = model_from_configuration(DeploymentState(nodes=[NodeState(uuid=node1_uuid, hostname=u'172.16.255.250'), NodeState(uuid=node2_uuid, hostname=u'172.16.255.251')]), applications, deployment_configuration)
    expected_result = Deployment(nodes=frozenset([Node(uuid=node1_uuid, applications={u'mysql-hybridcluster': Application(name=u'mysql-hybridcluster', image=DockerImage(repository=u'flocker/mysql', tag=u'v1.2.3'), ports=frozenset(), links=frozenset())}), Node(uuid=node2_uuid, applications={u'site-hybridcluster': Application(name=u'site-hybridcluster', image=DockerImage(repository=u'flocker/nginx', tag=u'v1.2.3'), ports=frozenset(), links=frozenset())})]))
    self.assertEqual(expected_result, result)
