@@ -0,0 +1,3348 @@
+# Copyright (c) 2014 Netflix, Inc. Stefan Praszalowicz%0A#%0A# Permission is hereby granted, free of charge, to any person obtaining a%0A# copy of this software and associated documentation files (the%0A# %22Software%22), to deal in the Software without restriction, including%0A# without limitation the rights to use, copy, modify, merge, publish, dis-%0A# tribute, sublicense, and/or sell copies of the Software, and to permit%0A# persons to whom the Software is furnished to do so, subject to the fol-%0A# lowing conditions:%0A#%0A# The above copyright notice and this permission notice shall be included%0A# in all copies or substantial portions of the Software.%0A#%0A# THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS%0A# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-%0A# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT%0A# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,%0A# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,%0A# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS%0A# IN THE SOFTWARE.%0A#%0A%0Aimport unittest%0Afrom boto.route53.connection import Route53Connection%0Afrom boto.route53.record import ResourceRecordSets%0Afrom boto.route53.exception import DNSServerError%0A%0A%0Aclass TestRoute53AliasResourceRecordSets(unittest.TestCase):%0A    route53 = True%0A%0A    def setUp(self):%0A        super(TestRoute53AliasResourceRecordSets, self).setUp()%0A        self.conn = Route53Connection()%0A        self.zone = self.conn.create_zone('example.com')%0A        self.zone.add_a('target.example.com', '102.11.23.1')  # a standard record to use as the target for our alias%0A%0A    def tearDown(self):%0A        self.zone.delete_a('target.example.com')%0A        self.zone.delete()%0A        super(TestRoute53AliasResourceRecordSets, self).tearDown()%0A%0A    def test_incomplete_add_alias_failure(self):%0A        base_record = dict(name=%22alias.example.com.%22,%0A                           type=%22A%22,%0A                           alias_dns_name=%22target.example.com%22,%0A                           alias_hosted_zone_id=self.zone.id,%0A                           identifier=%22boto:TestRoute53AliasResourceRecordSets%22)%0A%0A        rrs = ResourceRecordSets(self.conn, self.zone.id)%0A        rrs.add_change(action=%22UPSERT%22, **base_record)%0A%0A        try:%0A            self.assertRaises(DNSServerError, rrs.commit)%0A        except:%0A            # if the call somehow goes through, delete our unexpected new record before failing test%0A            rrs = ResourceRecordSets(self.conn, self.zone.id)%0A            rrs.add_change(action=%22DELETE%22, **base_record)%0A            rrs.commit()%0A            raise%0A%0A    def test_add_alias(self):%0A        base_record = dict(name=%22alias.example.com.%22,%0A                           type=%22A%22,%0A                           alias_evaluate_target_health=False,%0A                           alias_dns_name=%22target.example.com%22,%0A                           alias_hosted_zone_id=self.zone.id,%0A                           identifier=%22boto:TestRoute53AliasResourceRecordSets%22)%0A%0A        rrs = ResourceRecordSets(self.conn, self.zone.id)%0A        rrs.add_change(action=%22UPSERT%22, **base_record)%0A        rrs.commit()%0A%0A        rrs = ResourceRecordSets(self.conn, self.zone.id)%0A        rrs.add_change(action=%22DELETE%22, **base_record)%0A        rrs.commit()%0A%0A%0Aif __name__ == '__main__':%0A    unittest.main()%0A

add integration tests for alias rrs