Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Drop awsencode use in tests #246

Merged
merged 1 commit into from
Feb 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from testfixtures import compare

from troposphere import Base64, FindInMap, GetAZs, GetAtt, Join, Ref, Template, awsencode, ec2, iam, rds, s3
from troposphere import Base64, FindInMap, GetAZs, GetAtt, Join, Ref, Template, ec2, iam, rds, s3
from troposphere.autoscaling import AutoScalingGroup, LaunchConfiguration, Tag
from troposphere.ec2 import SecurityGroup, SecurityGroupIngress
from troposphere.elasticache import ReplicationGroup, SubnetGroup
Expand Down Expand Up @@ -59,10 +59,10 @@ def setUp(self):
self.maxDiff = 9000

def _resources_to_dict(self, resources):
return json.loads(json.dumps(
dict((r.title, r) for r in resources),
cls=awsencode)
)
resources_dict = {}
for resource in resources:
resources_dict[resource.title] = resource.to_dict()
return json.loads(json.dumps(resources_dict))

def test_iam_default(self):
basehost_role = iam.Role('BaseHostRole')
Expand Down Expand Up @@ -1164,8 +1164,6 @@ def test_elb_with_ssl(self):
config.elb(template)
elb_cfg = template.resources.values()

# elb_dict = json.loads(json.dumps([{r.title: r} for r in elb_cfg ],
# cls=awsencode))
compare(self._resources_to_dict(known),
self._resources_to_dict(elb_cfg))

Expand Down