'Test build.yaml is output correctly.'

def testWriteBuildYaml(self):

    context = ['Target:LinuxDeb', 'Platform:Linux', 'Target:Linux', 'Arch:amd64']
    expected = {'Client.build_environment': 'cp27-cp27mu-linux_x86_64', 'Client.build_time': '2016-05-24    20:04:25', 'Template.build_type': 'Release', 'Template.build_context': (['ClientBuilder    Context'] + context), 'Template.version_major': str(config.CONFIG.Get('Source.version_major')), 'Template.version_minor': str(config.CONFIG.Get('Source.version_minor')), 'Template.version_revision': str(config.CONFIG.Get('Source.version_revision')), 'Template.version_release': str(config.CONFIG.Get('Source.version_release')), 'Template.arch': u'amd64'}
    fd = StringIO.StringIO()
    builder = build.ClientBuilder(context=context)
    with mock.patch.object(rdf_client.Uname, 'FromCurrentSystem') as fcs:
        fcs.return_value.signature.return_value = 'cp27-cp27mu-linux_x86_64'
        with test_lib.FakeTime(1464120265):
            builder.WriteBuildYaml(fd)
    fd.seek(0)
    self.assertEqual(dict(yaml.load(fd)), expected)
