@@ -795,33 +795,12 @@ def my_client(rtype, *args):
795795 assert 'Resource Type' in result .output
796796
797797
798- def test_domains (monkeypatch , boto_client ):
798+ def test_domains (monkeypatch , boto_resource , boto_client ):
799799 senza .traffic .DNS_ZONE_CACHE = {}
800800 senza .traffic .DNS_RR_CACHE = {}
801801
802- def my_resource (rtype , * args ):
803- if rtype == 'cloudformation' :
804- res = MagicMock ()
805- res .resource_type = 'AWS::Route53::RecordSet'
806- res .physical_resource_id = 'test-1.example.org'
807- res .logical_id = 'VersionDomain'
808- res .last_updated_timestamp = datetime .datetime .now ()
809- res2 = MagicMock ()
810- res2 .resource_type = 'AWS::Route53::RecordSet'
811- res2 .physical_resource_id = 'mydomain.example.org'
812- res2 .logical_id = 'MainDomain'
813- res2 .last_updated_timestamp = datetime .datetime .now ()
814- stack = MagicMock ()
815- stack .resource_summaries .all .return_value = [res , res2 ]
816- cf = MagicMock ()
817- cf .Stack .return_value = stack
818- return cf
819- return MagicMock ()
820-
821802 boto_client ['route53' ].list_hosted_zones .return_value = {'HostedZones' : [HOSTED_ZONE_EXAMPLE_ORG ]}
822803
823- monkeypatch .setattr ('boto3.resource' , my_resource )
824-
825804 runner = CliRunner ()
826805
827806 data = {'SenzaInfo' : {'StackName' : 'test' ,
@@ -834,6 +813,7 @@ def my_resource(rtype, *args):
834813 catch_exceptions = False )
835814 assert 'mydomain.example.org' in result .output
836815 assert 'VersionDomain test-1.example.org CNAME test-1-123.myregion.elb.amazonaws.com' in result .output
816+ assert 'VersionDomain test-2.example.org A test-2-123.myregion.elb.amazonaws.com' in result .output
837817 assert 'MainDomain mydomain.example.org 20 CNAME test-1.example.org' in result .output
838818
839819
0 commit comments