'``Configuration.applications_from_configuration`` returns a
``dict`` of ``Application`` instances, one for each application key
in the supplied configuration.'

def test_dict_of_applications_from_fig(self):

    config = {u'wordpress': {u'environment': {u'WORDPRESS_ADMIN_PASSWORD': u'admin'}, u'volumes': [u'/var/www/wordpress'], u'image': u'sample/wordpress', u'ports': [u'8080:80'], u'links': [u'mysql:db']}, u'mysql': {u'image': u'sample/mysql', u'ports': [u'3306:3306', u'3307:3307']}}
    expected_applications = {u'wordpress': Application(name=u'wordpress', image=DockerImage(repository=u'sample/wordpress', tag=u'latest'), ports=frozenset([Port(internal_port=80, external_port=8080)]), links=frozenset([Link(local_port=3306, remote_port=3306, alias=u'db'), Link(local_port=3307, remote_port=3307, alias=u'db')]), environment=frozenset(config[u'wordpress'][u'environment'].items()), volume=AttachedVolume(manifestation=Manifestation(dataset=Dataset(dataset_id=dataset_id_from_name(u'wordpress'), metadata=pmap({u'name': u'wordpress'})), primary=True), mountpoint=FilePath('/var/www/wordpress'))), u'mysql': Application(name=u'mysql', image=DockerImage(repository=u'sample/mysql', tag=u'latest'), ports=frozenset([Port(internal_port=3306, external_port=3306), Port(internal_port=3307, external_port=3307)]), environment=None, links=frozenset(), volume=None)}
    parser = FigConfiguration(config)
    applications = parser.applications()
    self.assertEqual(expected_applications, applications)
