# Path: awslimitchecker/services/ses.py
# class _SesService(_AwsService):
# 
#     service_name = 'SES'
#     api_name = 'ses'  # AWS API name to connect to (boto3.client)
# 
#     def find_usage(self):
#         """
#         Determine the current usage for each limit of this service,
#         and update corresponding Limit via
#         :py:meth:`~.AwsLimit._add_current_usage`.
#         """
#         logger.debug("Checking usage for service %s", self.service_name)
#         for lim in self.limits.values():
#             lim._reset_usage()
#         try:
#             self.connect()
#             resp = self.conn.get_send_quota()
#         except EndpointConnectionError as ex:
#             logger.warning('Skipping SES: %s', str(ex))
#             return
#         except ClientError as ex:
#             if ex.response['Error']['Code'] in ['AccessDenied', '503']:
#                 logger.warning('Skipping SES: %s', ex)
#                 return
#             raise
#         except ConnectTimeoutError as ex:
#             logger.warning('Skipping SES: %s', str(ex))
#             return
#         self.limits['Daily sending quota']._add_current_usage(
#             resp['SentLast24Hours']
#         )
#         self._have_usage = True
#         logger.debug("Done checking usage.")
# 
#     def get_limits(self):
#         """
#         Return all known limits for this service, as a dict of their names
#         to :py:class:`~.AwsLimit` objects.
# 
#         :returns: dict of limit names to :py:class:`~.AwsLimit` objects
#         :rtype: dict
#         """
#         if self.limits != {}:
#             return self.limits
#         limits = {}
#         limits['Daily sending quota'] = AwsLimit(
#             'Daily sending quota',
#             self,
#             200,
#             self.warning_threshold,
#             self.critical_threshold,
#             limit_type='AWS::SES::Email',
#         )
#         self.limits = limits
#         return limits
# 
#     def _update_limits_from_api(self):
#         """
#         Call the service's API action to retrieve limit/quota information, and
#         update AwsLimit objects in ``self.limits`` with this information.
#         """
#         try:
#             self.connect()
#             resp = self.conn.get_send_quota()
#         except EndpointConnectionError as ex:
#             logger.warning('Skipping SES: %s', str(ex))
#             return
#         except ClientError as ex:
#             if ex.response['Error']['Code'] in ['AccessDenied', '503']:
#                 logger.warning('Skipping SES: %s', ex)
#                 return
#             raise
#         except ConnectTimeoutError as ex:
#             logger.warning('Skipping SES: %s', str(ex))
#             return
#         self.limits['Daily sending quota']._set_api_limit(resp['Max24HourSend'])
# 
#     def required_iam_permissions(self):
#         """
#         Return a list of IAM Actions required for this Service to function
#         properly. All Actions will be shown with an Effect of "Allow"
#         and a Resource of "*".
# 
#         :returns: list of IAM Action strings
#         :rtype: list
#         """
#         return [
#             "ses:GetSendQuota",
#         ]


import sys
import pytest
from awslimitchecker.services.ses import _SesService
from botocore.exceptions import (
    ClientError, EndpointConnectionError, ConnectTimeoutError
)
    from mock import patch, call, Mock
    from unittest.mock import patch, call, Mock
################################################################################
While not legally required, I sincerely request that anyone who finds
bugs please submit them at <https://github.com/jantman/awslimitchecker> or
to me via email, and that you send any contributions or improvements
either as a pull request on GitHub, or to me via email.
################################################################################

AUTHORS:
Jason Antman <jason@jasonantman.com> <http://www.jasonantman.com>
################################################################################
"""


# https://code.google.com/p/mock/issues/detail?id=249
# py>=3.4 should use unittest.mock not the mock package on pypi
if (
        sys.version_info[0] < 3 or
        sys.version_info[0] == 3 and sys.version_info[1] < 4
):
else:


pbm = 'awslimitchecker.services.ses'  # module patch base
pb = '%s._SesService' % pbm  # class patch pase


class Test_SesService(object):

    def test_init(self):
        """test __init__()"""

# Path: awslimitchecker/services/ses.py
# class _SesService(_AwsService):
# 
#     service_name = 'SES'
#     api_name = 'ses'  # AWS API name to connect to (boto3.client)
# 
#     def find_usage(self):
#         """
#         Determine the current usage for each limit of this service,
#         and update corresponding Limit via
#         :py:meth:`~.AwsLimit._add_current_usage`.
#         """
#         logger.debug("Checking usage for service %s", self.service_name)
#         for lim in self.limits.values():
#             lim._reset_usage()
#         try:
#             self.connect()
#             resp = self.conn.get_send_quota()
#         except EndpointConnectionError as ex:
#             logger.warning('Skipping SES: %s', str(ex))
#             return
#         except ClientError as ex:
#             if ex.response['Error']['Code'] in ['AccessDenied', '503']:
#                 logger.warning('Skipping SES: %s', ex)
#                 return
#             raise
#         except ConnectTimeoutError as ex:
#             logger.warning('Skipping SES: %s', str(ex))
#             return
#         self.limits['Daily sending quota']._add_current_usage(
#             resp['SentLast24Hours']
#         )
#         self._have_usage = True
#         logger.debug("Done checking usage.")
# 
#     def get_limits(self):
#         """
#         Return all known limits for this service, as a dict of their names
#         to :py:class:`~.AwsLimit` objects.
# 
#         :returns: dict of limit names to :py:class:`~.AwsLimit` objects
#         :rtype: dict
#         """
#         if self.limits != {}:
#             return self.limits
#         limits = {}
#         limits['Daily sending quota'] = AwsLimit(
#             'Daily sending quota',
#             self,
#             200,
#             self.warning_threshold,
#             self.critical_threshold,
#             limit_type='AWS::SES::Email',
#         )
#         self.limits = limits
#         return limits
# 
#     def _update_limits_from_api(self):
#         """
#         Call the service's API action to retrieve limit/quota information, and
#         update AwsLimit objects in ``self.limits`` with this information.
#         """
#         try:
#             self.connect()
#             resp = self.conn.get_send_quota()
#         except EndpointConnectionError as ex:
#             logger.warning('Skipping SES: %s', str(ex))
#             return
#         except ClientError as ex:
#             if ex.response['Error']['Code'] in ['AccessDenied', '503']:
#                 logger.warning('Skipping SES: %s', ex)
#                 return
#             raise
#         except ConnectTimeoutError as ex:
#             logger.warning('Skipping SES: %s', str(ex))
#             return
#         self.limits['Daily sending quota']._set_api_limit(resp['Max24HourSend'])
# 
#     def required_iam_permissions(self):
#         """
#         Return a list of IAM Actions required for this Service to function
#         properly. All Actions will be shown with an Effect of "Allow"
#         and a Resource of "*".
# 
#         :returns: list of IAM Action strings
#         :rtype: list
#         """
#         return [
#             "ses:GetSendQuota",
#         ]


# Path: awslimitchecker/tests/services/test_ses.py
import sys
import pytest
from awslimitchecker.services.ses import _SesService
from botocore.exceptions import (
    ClientError, EndpointConnectionError, ConnectTimeoutError
)
    from mock import patch, call, Mock
    from unittest.mock import patch, call, Mock

################################################################################
While not legally required, I sincerely request that anyone who finds
bugs please submit them at <https://github.com/jantman/awslimitchecker> or
to me via email, and that you send any contributions or improvements
either as a pull request on GitHub, or to me via email.
################################################################################

AUTHORS:
Jason Antman <jason@jasonantman.com> <http://www.jasonantman.com>
################################################################################
"""


# https://code.google.com/p/mock/issues/detail?id=249
# py>=3.4 should use unittest.mock not the mock package on pypi
if (
        sys.version_info[0] < 3 or
        sys.version_info[0] == 3 and sys.version_info[1] < 4
):
else:


pbm = 'awslimitchecker.services.ses'  # module patch base
pb = '%s._SesService' % pbm  # class patch pase


class Test_SesService(object):

    def test_init(self):
        """test __init__()"""

        cls = _SesService(21, 43, {}, None)