#NEWLINE# def test_resource_with_metadata( self ) : #NEWLINE# #INDENT# metadata = core . Metadata ( { #NEWLINE# #INDENT# 'Object1' : 'Location1' , #NEWLINE# 'Object2' : 'Location2' , #NEWLINE# #UNINDENT# } ) #NEWLINE# res = core . Resource ( 'TestResource' , 'AWS::Resource::Test' , None , metadata ) #NEWLINE# cft = core . CloudFormationTemplate ( ) #NEWLINE# cft . resources . test = res #NEWLINE# expected_out = dedent ( '        {\n          "Type": "AWS::Resource::Test",\n          "Metadata": {\n            "Object1": "Location1",\n            "Object2": "Location2"\n          }\n        }' ) #NEWLINE# self . assertEqual ( unicode ( cft . resources . test ) , metadata )