Adding missing health_check value for weighted record sets. #2195
Conversation
I didn't see any test cases for this area of the code. Any guidance on how I should proceed? |
Thanks for catching this oversight. The PR looks good, but does need tests. You can model your test on one like the following: class TestCreateZoneRoute53(AWSMockServiceTestCase):
connection_class = Route53Connection
def default_body(self):
return """
<CreateHostedZoneResponse xmlns="https://route53.amazonaws.com/doc/2012-02-29/">
<HostedZone>
<Id>/hostedzone/Z11111</Id>
<Name>example.com.</Name>
<CallerReference>aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee</CallerReference>
<Config>
<Comment></Comment>
</Config>
<ResourceRecordSetCount>2</ResourceRecordSetCount>
</HostedZone>
<ChangeInfo>
<Id>/change/C1111111111111</Id>
<Status>PENDING</Status>
<SubmittedAt>2014-02-02T10:19:29.928Z</SubmittedAt>
</ChangeInfo>
<DelegationSet>
<NameServers>
<NameServer>ns-100.awsdns-01.com</NameServer>
<NameServer>ns-1000.awsdns-01.co.uk</NameServer>
<NameServer>ns-1000.awsdns-01.org</NameServer>
<NameServer>ns-900.awsdns-01.net</NameServer>
</NameServers>
</DelegationSet>
</CreateHostedZoneResponse>
"""
def test_create_zone(self):
self.set_http_response(status_code=201)
response = self.service_connection.create_zone("example.com.")
self.assertTrue(isinstance(response, Zone))
self.assertEqual(response.id, "Z11111")
self.assertEqual(response.name, "example.com.") https://github.com/boto/boto/blob/develop/tests/unit/route53/test_connection.py#L91-L131 In it, you create a mocked response, do the call and then check the built response object to make sure |
To others that are using boto as an external thirdparty only (ie. you don't want to make people that use your code have to have a custom patched version of boto), you can do something like this to monkeypatch the endElement function on the boto class (version 2.27.0 only) as an interim solution until this PR is merged (note: you have to implement the monkey patch after you have called boto.connect_route53() due to the dynamic loading of modules)
|
Sorry, I have been busy and forgot to finish this up. I will try to get to it tomorrow afternoon. |
OK. Added checks to the existing get all rrsets test. |
Is there anything holding this up from being merged? Just checking in, we are currently running a custom fork of boto and would like to get back to the official repo in the next release if possible. |
Conflicts: boto/route53/record.py
Sorry, this looks good now, thanks! |
Fix for issue #2194.