# Path: awslimitchecker/services/autoscaling.py
# class _AutoscalingService(_AwsService):
# 
#     service_name = 'AutoScaling'
#     api_name = 'autoscaling'
#     quotas_service_code = 'autoscaling'
# 
#     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)
#         self.connect()
#         for lim in self.limits.values():
#             lim._reset_usage()
# 
#         self.limits['Auto Scaling groups']._add_current_usage(
#             len(
#                 paginate_dict(
#                     self.conn.describe_auto_scaling_groups,
#                     alc_marker_path=['NextToken'],
#                     alc_data_path=['AutoScalingGroups'],
#                     alc_marker_param='NextToken'
#                 )['AutoScalingGroups']
#             ),
#             aws_type='AWS::AutoScaling::AutoScalingGroup',
#         )
# 
#         self.limits['Launch configurations']._add_current_usage(
#             len(
#                 paginate_dict(
#                     self.conn.describe_launch_configurations,
#                     alc_marker_path=['NextToken'],
#                     alc_data_path=['LaunchConfigurations'],
#                     alc_marker_param='NextToken'
#                 )['LaunchConfigurations']
#             ),
#             aws_type='AWS::AutoScaling::LaunchConfiguration',
#         )
#         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 = {}
#         # autoscaleconnection.get_all_groups()
#         limits['Auto Scaling groups'] = AwsLimit(
#             'Auto Scaling groups',
#             self,
#             200,
#             self.warning_threshold,
#             self.critical_threshold,
#             limit_type='AWS::AutoScaling::AutoScalingGroup',
#             quotas_name='Auto Scaling groups per region'
#         )
#         # autoscaleconnection.get_all_launch_configurations()
#         limits['Launch configurations'] = AwsLimit(
#             'Launch configurations',
#             self,
#             200,
#             self.warning_threshold,
#             self.critical_threshold,
#             limit_type='AWS::AutoScaling::LaunchConfiguration',
#             quotas_name='Launch configurations per region'
#         )
#         self.limits = limits
#         return limits
# 
#     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 [
#             'autoscaling:DescribeAccountLimits',
#             'autoscaling:DescribeAutoScalingGroups',
#             'autoscaling:DescribeLaunchConfigurations',
#         ]
# 
#     def _update_limits_from_api(self):
#         """
#         Query EC2's DescribeAccountAttributes API action, and update limits
#         with the quotas returned. Updates ``self.limits``.
#         """
#         self.connect()
#         logger.info("Querying EC2 DescribeAccountAttributes for limits")
#         lims = self.conn.describe_account_limits()
#         self.limits['Auto Scaling groups']._set_api_limit(
#             lims['MaxNumberOfAutoScalingGroups'])
#         self.limits['Launch configurations']._set_api_limit(
#             lims['MaxNumberOfLaunchConfigurations'])


import sys
from awslimitchecker.services.autoscaling import _AutoscalingService
    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:


class Test_AutoscalingService(object):

    # path base paths
    pb = 'awslimitchecker.services.autoscaling._AutoscalingService'
    pbm = 'awslimitchecker.services.autoscaling'

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

# Path: awslimitchecker/services/autoscaling.py
# class _AutoscalingService(_AwsService):
# 
#     service_name = 'AutoScaling'
#     api_name = 'autoscaling'
#     quotas_service_code = 'autoscaling'
# 
#     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)
#         self.connect()
#         for lim in self.limits.values():
#             lim._reset_usage()
# 
#         self.limits['Auto Scaling groups']._add_current_usage(
#             len(
#                 paginate_dict(
#                     self.conn.describe_auto_scaling_groups,
#                     alc_marker_path=['NextToken'],
#                     alc_data_path=['AutoScalingGroups'],
#                     alc_marker_param='NextToken'
#                 )['AutoScalingGroups']
#             ),
#             aws_type='AWS::AutoScaling::AutoScalingGroup',
#         )
# 
#         self.limits['Launch configurations']._add_current_usage(
#             len(
#                 paginate_dict(
#                     self.conn.describe_launch_configurations,
#                     alc_marker_path=['NextToken'],
#                     alc_data_path=['LaunchConfigurations'],
#                     alc_marker_param='NextToken'
#                 )['LaunchConfigurations']
#             ),
#             aws_type='AWS::AutoScaling::LaunchConfiguration',
#         )
#         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 = {}
#         # autoscaleconnection.get_all_groups()
#         limits['Auto Scaling groups'] = AwsLimit(
#             'Auto Scaling groups',
#             self,
#             200,
#             self.warning_threshold,
#             self.critical_threshold,
#             limit_type='AWS::AutoScaling::AutoScalingGroup',
#             quotas_name='Auto Scaling groups per region'
#         )
#         # autoscaleconnection.get_all_launch_configurations()
#         limits['Launch configurations'] = AwsLimit(
#             'Launch configurations',
#             self,
#             200,
#             self.warning_threshold,
#             self.critical_threshold,
#             limit_type='AWS::AutoScaling::LaunchConfiguration',
#             quotas_name='Launch configurations per region'
#         )
#         self.limits = limits
#         return limits
# 
#     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 [
#             'autoscaling:DescribeAccountLimits',
#             'autoscaling:DescribeAutoScalingGroups',
#             'autoscaling:DescribeLaunchConfigurations',
#         ]
# 
#     def _update_limits_from_api(self):
#         """
#         Query EC2's DescribeAccountAttributes API action, and update limits
#         with the quotas returned. Updates ``self.limits``.
#         """
#         self.connect()
#         logger.info("Querying EC2 DescribeAccountAttributes for limits")
#         lims = self.conn.describe_account_limits()
#         self.limits['Auto Scaling groups']._set_api_limit(
#             lims['MaxNumberOfAutoScalingGroups'])
#         self.limits['Launch configurations']._set_api_limit(
#             lims['MaxNumberOfLaunchConfigurations'])


# Path: awslimitchecker/tests/services/test_autoscaling.py
import sys
from awslimitchecker.services.autoscaling import _AutoscalingService
    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:


class Test_AutoscalingService(object):

    # path base paths
    pb = 'awslimitchecker.services.autoscaling._AutoscalingService'
    pbm = 'awslimitchecker.services.autoscaling'

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

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