Example #1
0
    def test_find_usage_network_interfaces(self):
        response = result_fixtures.VPC.test_find_usage_network_interfaces

        mock_conn = Mock()
        mock_conn.describe_network_interfaces.return_value = response

        cls = _VpcService(21, 43)
        cls.conn = mock_conn

        cls._find_usage_network_interfaces()

        assert len(cls.limits['Network interfaces per Region']
                   .get_current_usage()) == 1
        assert cls.limits['Network interfaces per Region'].get_current_usage()[
            0].get_value() == 1
        assert mock_conn.mock_calls == [
            call.describe_network_interfaces(),
        ]
Example #2
0
    def test_find_usage_network_interfaces(self):
        response = result_fixtures.VPC.test_find_usage_network_interfaces

        mock_conn = Mock()
        mock_conn.describe_network_interfaces.return_value = response

        cls = _VpcService(21, 43)
        cls.conn = mock_conn

        cls._find_usage_network_interfaces()

        assert len(cls.limits['Network interfaces per Region']
                   .get_current_usage()) == 1
        assert cls.limits['Network interfaces per Region'].get_current_usage()[
            0].get_value() == 1
        assert mock_conn.mock_calls == [
            call.describe_network_interfaces(),
        ]
Example #3
0
    def test_find_usage_network_interfaces(self):
        response = result_fixtures.VPC.test_find_usage_network_interfaces

        mock_conn = Mock()
        mock_conn.describe_network_interfaces.return_value = response

        cls = _VpcService(21, 43, {}, None)
        cls._current_account_id = '0123456789'
        cls.conn = mock_conn

        cls._find_usage_network_interfaces()

        assert len(cls.limits['Network interfaces per Region'].
                   get_current_usage()) == 1
        assert cls.limits['Network interfaces per Region'].get_current_usage(
        )[0].get_value() == 1
        assert mock_conn.mock_calls == [
            call.describe_network_interfaces(Filters=[{
                'Name': 'owner-id',
                'Values': ['0123456789']
            }]),
        ]