# Path: awslimitchecker/tests/services/result_fixtures.py
# def get_boto3_resource_model(service_name, resource_name):
#     def test_instance_usage(self):
#     def test_instance_usage_vcpu(self):
#     def test_instance_usage_key_error(self):
#     def test_find_usage_networking_sgs(self):
#     def test_find_usage_networking_eips(self):
#     def test_find_usage_networking_eni_sg(self):
# class EBS(object):
# class VPC(object):
# class RDS(object):
# class ElasticBeanstalk(object):
# class CloudFront(object):
# class ELB(object):
# class Lambda(object):
# class ElastiCache(object):
# class EC2(object):
# class IAM(object):
# class Firehose(object):
# class Redshift(object):
# class ApiGateway(object):
# class DynamoDB(object):
# class Route53(object):
# class CloudTrail(object):
# class Kinesis(object):
# class EKS(object):
# class CertificateManager(object):
# 
# Path: awslimitchecker/services/elasticbeanstalk.py
# class _ElasticBeanstalkService(_AwsService):
# 
#     service_name = 'ElasticBeanstalk'
#     api_name = 'elasticbeanstalk'  # 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)
#         self.connect()
#         for lim in self.limits.values():
#             lim._reset_usage()
#         self._find_usage_applications()
#         self._find_usage_application_versions()
#         self._find_usage_environments()
#         self._have_usage = True
#         logger.debug("Done checking usage.")
# 
#     def _find_usage_applications(self):
#         """find usage for ElasticBeanstalk applications"""
#         applications = self.conn.describe_applications()
#         self.limits['Applications']._add_current_usage(
#             len(applications['Applications']),
#             aws_type='AWS::ElasticBeanstalk::Application',
#         )
# 
#     def _find_usage_application_versions(self):
#         """find usage for ElasticBeanstalk application verions"""
#         versions = self.conn.describe_application_versions()
#         self.limits['Application versions']._add_current_usage(
#             len(versions['ApplicationVersions']),
#             aws_type='AWS::ElasticBeanstalk::ApplicationVersion',
#         )
# 
#     def _find_usage_environments(self):
#         """find usage for ElasticBeanstalk environments"""
#         environments = self.conn.describe_environments()
#         self.limits['Environments']._add_current_usage(
#             len(environments['Environments']),
#             aws_type='AWS::ElasticBeanstalk::Environment',
#         )
# 
#     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['Applications'] = AwsLimit(
#             'Applications',
#             self,
#             75,
#             self.warning_threshold,
#             self.critical_threshold,
#             limit_type='AWS::ElasticBeanstalk::Application',
#         )
#         limits['Application versions'] = AwsLimit(
#             'Application versions',
#             self,
#             1000,
#             self.warning_threshold,
#             self.critical_threshold,
#             limit_type='AWS::ElasticBeanstalk::ApplicationVersion',
#         )
#         limits['Environments'] = AwsLimit(
#             'Environments',
#             self,
#             200,
#             self.warning_threshold,
#             self.critical_threshold,
#             limit_type='AWS::ElasticBeanstalk::Environment',
#         )
#         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 [
#             "elasticbeanstalk:DescribeApplications",
#             "elasticbeanstalk:DescribeApplicationVersions",
#             "elasticbeanstalk:DescribeEnvironments",
#         ]


import sys
from awslimitchecker.tests.services import result_fixtures
from awslimitchecker.services.elasticbeanstalk import _ElasticBeanstalkService
    from mock import patch, call, Mock, DEFAULT
    from unittest.mock import patch, call, Mock, DEFAULT
        cls = _ElasticBeanstalkService(21, 43, {}, None)
        cls.limits = mock_limits
        res = cls.get_limits()
        assert res == mock_limits

    def test_find_usage(self):
        """test find usage method calls other methods"""
        mock_conn = Mock()
        with patch('%s.connect' % pb) as mock_connect:
            with patch.multiple(
                pb,
                _find_usage_applications=DEFAULT,
                _find_usage_application_versions=DEFAULT,
                _find_usage_environments=DEFAULT,
            ) as mocks:
                cls = _ElasticBeanstalkService(21, 43, {}, None)
                cls.conn = mock_conn
                assert cls._have_usage is False
                cls.find_usage()
        assert mock_connect.mock_calls == [call()]
        assert cls._have_usage is True
        assert mock_conn.mock_calls == []
        for x in [
            '_find_usage_applications',
            '_find_usage_application_versions',
            '_find_usage_environments',
        ]:
            assert mocks[x].mock_calls == [call()]

    def test_find_usage_applications(self):

# Path: awslimitchecker/tests/services/result_fixtures.py
# def get_boto3_resource_model(service_name, resource_name):
#     def test_instance_usage(self):
#     def test_instance_usage_vcpu(self):
#     def test_instance_usage_key_error(self):
#     def test_find_usage_networking_sgs(self):
#     def test_find_usage_networking_eips(self):
#     def test_find_usage_networking_eni_sg(self):
# class EBS(object):
# class VPC(object):
# class RDS(object):
# class ElasticBeanstalk(object):
# class CloudFront(object):
# class ELB(object):
# class Lambda(object):
# class ElastiCache(object):
# class EC2(object):
# class IAM(object):
# class Firehose(object):
# class Redshift(object):
# class ApiGateway(object):
# class DynamoDB(object):
# class Route53(object):
# class CloudTrail(object):
# class Kinesis(object):
# class EKS(object):
# class CertificateManager(object):
# 
# Path: awslimitchecker/services/elasticbeanstalk.py
# class _ElasticBeanstalkService(_AwsService):
# 
#     service_name = 'ElasticBeanstalk'
#     api_name = 'elasticbeanstalk'  # 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)
#         self.connect()
#         for lim in self.limits.values():
#             lim._reset_usage()
#         self._find_usage_applications()
#         self._find_usage_application_versions()
#         self._find_usage_environments()
#         self._have_usage = True
#         logger.debug("Done checking usage.")
# 
#     def _find_usage_applications(self):
#         """find usage for ElasticBeanstalk applications"""
#         applications = self.conn.describe_applications()
#         self.limits['Applications']._add_current_usage(
#             len(applications['Applications']),
#             aws_type='AWS::ElasticBeanstalk::Application',
#         )
# 
#     def _find_usage_application_versions(self):
#         """find usage for ElasticBeanstalk application verions"""
#         versions = self.conn.describe_application_versions()
#         self.limits['Application versions']._add_current_usage(
#             len(versions['ApplicationVersions']),
#             aws_type='AWS::ElasticBeanstalk::ApplicationVersion',
#         )
# 
#     def _find_usage_environments(self):
#         """find usage for ElasticBeanstalk environments"""
#         environments = self.conn.describe_environments()
#         self.limits['Environments']._add_current_usage(
#             len(environments['Environments']),
#             aws_type='AWS::ElasticBeanstalk::Environment',
#         )
# 
#     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['Applications'] = AwsLimit(
#             'Applications',
#             self,
#             75,
#             self.warning_threshold,
#             self.critical_threshold,
#             limit_type='AWS::ElasticBeanstalk::Application',
#         )
#         limits['Application versions'] = AwsLimit(
#             'Application versions',
#             self,
#             1000,
#             self.warning_threshold,
#             self.critical_threshold,
#             limit_type='AWS::ElasticBeanstalk::ApplicationVersion',
#         )
#         limits['Environments'] = AwsLimit(
#             'Environments',
#             self,
#             200,
#             self.warning_threshold,
#             self.critical_threshold,
#             limit_type='AWS::ElasticBeanstalk::Environment',
#         )
#         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 [
#             "elasticbeanstalk:DescribeApplications",
#             "elasticbeanstalk:DescribeApplicationVersions",
#             "elasticbeanstalk:DescribeEnvironments",
#         ]


# Path: awslimitchecker/tests/services/test_elasticbeanstalk.py
import sys
from awslimitchecker.tests.services import result_fixtures
from awslimitchecker.services.elasticbeanstalk import _ElasticBeanstalkService
    from mock import patch, call, Mock, DEFAULT
    from unittest.mock import patch, call, Mock, DEFAULT

        cls = _ElasticBeanstalkService(21, 43, {}, None)
        cls.limits = mock_limits
        res = cls.get_limits()
        assert res == mock_limits

    def test_find_usage(self):
        """test find usage method calls other methods"""
        mock_conn = Mock()
        with patch('%s.connect' % pb) as mock_connect:
            with patch.multiple(
                pb,
                _find_usage_applications=DEFAULT,
                _find_usage_application_versions=DEFAULT,
                _find_usage_environments=DEFAULT,
            ) as mocks:
                cls = _ElasticBeanstalkService(21, 43, {}, None)
                cls.conn = mock_conn
                assert cls._have_usage is False
                cls.find_usage()
        assert mock_connect.mock_calls == [call()]
        assert cls._have_usage is True
        assert mock_conn.mock_calls == []
        for x in [
            '_find_usage_applications',
            '_find_usage_application_versions',
            '_find_usage_environments',
        ]:
            assert mocks[x].mock_calls == [call()]

    def test_find_usage_applications(self):

        response = result_fixtures.ElasticBeanstalk.test_find_usage_applications