From 0cd65f8cac2cb79ea469cd3473d56ecc3df33dd7 Mon Sep 17 00:00:00 2001 From: Chris Alfonso Date: Mon, 14 May 2012 09:55:50 -0400 Subject: [PATCH] Fix pep8 errors --- heat/tests/test_cfn.py | 10 +++++++--- heat/tests/test_validate.py | 37 ++++++++++++++++++++++++++----------- 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/heat/tests/test_cfn.py b/heat/tests/test_cfn.py index 44cc77aa35..c1ea573208 100644 --- a/heat/tests/test_cfn.py +++ b/heat/tests/test_cfn.py @@ -142,7 +142,10 @@ class MetadataTest(unittest.TestCase): "AWS::CloudFormation::Init" : { "config" : { "sources": { - "/home/ec2-user/sample" : "https://s3.amazonaws.com/cloudformation-examples/CloudFormationRailsSample.zip" +''' + \ + '"/home/ec2-user/sample" : "https://s3.amazonaws.com/' + \ + 'cloudformation-examples/CloudFormationRailsSample.zip"' + \ + ''' }, "files" : { "/tmp/_files_test_/epel.repo" : { @@ -180,8 +183,9 @@ class MetadataTest(unittest.TestCase): self.m.StubOutWithMock(os, 'chmod') subprocess.Popen(['su', 'root', '-c', - 'wget -O /tmp/CloudFormationRailsSample.zip \ -https://s3.amazonaws.com/cloudformation-examples/CloudFormationRailsSample.zip'], + 'wget -O /tmp/CloudFormationRailsSample.zip ' + \ + 'https://s3.amazonaws.com/cloudformation-' + \ + 'examples/CloudFormationRailsSample.zip'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).AndReturn(PopenMock()) diff --git a/heat/tests/test_validate.py b/heat/tests/test_validate.py index a1ad840890..4d90e4437d 100644 --- a/heat/tests/test_validate.py +++ b/heat/tests/test_validate.py @@ -56,7 +56,10 @@ test_template_ref = ''' "Parameters" : { "KeyName" : { - "Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instances", +''' + \ + '"Description" : "Name of an existing EC2' + \ + 'KeyPair to enable SSH access to the instances",' + \ +''' "Type" : "String" } }, @@ -93,9 +96,11 @@ test_template_findinmap_valid = ''' "AWSTemplateFormatVersion" : "2010-09-09", "Description" : "test.", "Parameters" : { - "KeyName" : { - "Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instances", +''' + \ + '"Description" : "Name of an existing EC2 KeyPair to' + \ + 'enable SSH access to the instances",' + \ +''' "Type" : "String" } }, @@ -135,8 +140,10 @@ test_template_findinmap_invalid = ''' "Parameters" : { "KeyName" : { - "Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instances", - "Type" : "String" +''' + \ + '"Description" : "Name of an existing EC2 KeyPair to enable SSH ' + \ + 'access to the instances",' + \ +''' "Type" : "String" } }, @@ -161,8 +168,12 @@ test_template_findinmap_invalid = ''' "WikiDatabase": { "Type": "AWS::EC2::Instance", "Properties": { - "ImageId" : { "Fn::FindInMap" : [ "DistroArch2AMI", { "Ref" : "LinuxDistribution" }, - { "Fn::FindInMap" : [ "AWSInstanceType2Arch", { "Ref" : "InstanceType" }, "Arch" ] } ] }, +''' + \ + '"ImageId" : { "Fn::FindInMap" : [ "DistroArch2AMI", { "Ref" : ' + \ + '"LinuxDistribution" },' + \ + '{ "Fn::FindInMap" : [ "AWSInstanceType2Arch", { "Ref" : ' + \ + '"InstanceType" }, "Arch" ] } ] },' + \ +''' "InstanceType": "m1.large", "KeyName": "test_KeyName" } @@ -244,7 +255,8 @@ class validateTest(unittest.TestCase): self.m.ReplayAll() manager = managers.EngineManager() - res = dict(manager.validate_template(None, t, params)['ValidateTemplateResult']) + res = dict(manager.\ + validate_template(None, t, params)['ValidateTemplateResult']) print 'res %s' % res assert (res['Description'] == 'Successfully validated') @@ -259,7 +271,8 @@ class validateTest(unittest.TestCase): self.m.ReplayAll() manager = managers.EngineManager() - res = dict(manager.validate_template(None, t, params)['ValidateTemplateResult']) + res = dict(manager.\ + validate_template(None, t, params)['ValidateTemplateResult']) assert (res['Description'] != 'Successfully validated') def test_validate_findinmap_valid(self): @@ -273,7 +286,8 @@ class validateTest(unittest.TestCase): self.m.ReplayAll() manager = managers.EngineManager() - res = dict(manager.validate_template(None, t, params)['ValidateTemplateResult']) + res = dict(manager.\ + validate_template(None, t, params)['ValidateTemplateResult']) assert (res['Description'] == 'Successfully validated') def test_validate_findinmap_invalid(self): @@ -287,7 +301,8 @@ class validateTest(unittest.TestCase): self.m.ReplayAll() manager = managers.EngineManager() - res = dict(manager.validate_template(None, t, params)['ValidateTemplateResult']) + res = dict(manager.\ + validate_template(None, t, params)['ValidateTemplateResult']) assert (res['Description'] != 'Successfully validated') # allows testing of the test directly, shown below