Fix pep8 errors

This commit is contained in:
Chris Alfonso 2012-05-14 09:55:50 -04:00
parent 596b74d72a
commit 0cd65f8cac
2 changed files with 33 additions and 14 deletions

View File

@ -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())

View File

@ -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