'Tests coalesce_brackets on a dictionary.'

def testCoalesceBracketsOnDict(self):

    try:
        style.SetGlobalStyle(style.CreateStyleFromConfig('{based_on_style:    chromium,    coalesce_brackets:    True}'))
        unformatted_code = textwrap.dedent("                                        date_time_values    =    {\n                                                        u'year':    year,\n                                                        u'month':    month,\n                                                        u'day_of_month':    day_of_month,\n                                                        u'hours':    hours,\n                                                        u'minutes':    minutes,\n                                                        u'seconds':    seconds\n                                        }\n                                        ")
        expected_formatted_code = textwrap.dedent("                                        date_time_values    =    {\n                                                        u'year':    year,\n                                                        u'month':    month,\n                                                        u'day_of_month':    day_of_month,\n                                                        u'hours':    hours,\n                                                        u'minutes':    minutes,\n                                                        u'seconds':    seconds}\n                                        ")
        uwlines = yapf_test_helper.ParseAndUnwrap(unformatted_code)
        self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(uwlines))
    finally:
        style.SetGlobalStyle(style.CreateChromiumStyle())
