def test_class_status(self):
        res_id = "test_resource"
        client = self.make_client_function("get_hosted_zone",
                                           return_value="zone")
        route = hosted_zone.Route53HostedZone(None, res_id, client,
                                              MagicMock())
        res = route.status
        self.assertEqual(res, "available")

        client = self.make_client_function(
            "get_hosted_zone",
            side_effect=self.get_client_error_exception("Error"))
        route = hosted_zone.Route53HostedZone(None, res_id, client,
                                              MagicMock())
        res = route.status
        self.assertIsNone(res)
 def test_class_delete(self):
     res_id = "test_resource"
     client = self.make_client_function("delete_hosted_zone",
                                        return_value='deleted')
     route = hosted_zone.Route53HostedZone(None, res_id, client,
                                           MagicMock())
     res = route.delete()
     self.assertEqual(res, "deleted")
    def test_class_create(self):
        res_id = "test_resource"
        params = {'HostedZone': {'Id': 'test_id'}}
        client = self.make_client_function("create_hosted_zone",
                                           return_value=params)
        route = hosted_zone.Route53HostedZone(None, res_id, client,
                                              MagicMock())

        self.assertEqual(route.create(params)['HostedZone']['Id'], "test_id")
 def test_class_list_resource(self):
     res_id = "test_resource"
     params = {'ResourceRecordSets': 'listed'}
     client = self.make_client_function("list_resource_record_sets",
                                        return_value=params)
     route = hosted_zone.Route53HostedZone(None, res_id, client,
                                           MagicMock())
     res = route.list_resource_record_sets(params)
     self.assertEqual(res, "listed")