# Path: tests/conftest.py
# CAPAKEY_URL = 'https://geoservices.informatievlaanderen.be/capakey/api/v2'
# 
# Path: crabpy/gateway/capakey.py
# def capakey_rest_gateway_request(url, headers={}, params={}):
#     def __init__(self, **kwargs):
#     def _parse_centroid(center):
#     def _parse_bounding_box(bounding_box):
#     def list_gemeenten(self, sort=1):
#         def creator():
#     def get_gemeente_by_id(self, id):
#         def creator():
#     def list_kadastrale_afdelingen(self):
#         def creator():
#     def list_kadastrale_afdelingen_by_gemeente(self, gemeente, sort=1):
#         def creator():
#     def get_kadastrale_afdeling_by_id(self, aid):
#         def creator():
#     def list_secties_by_afdeling(self, afdeling):
#         def creator():
#     def get_sectie_by_id_and_afdeling(self, id, afdeling):
#         def creator():
#     def parse_percid(self, capakey):
#     def parse_capakey(self, percid):
#     def list_percelen_by_sectie(self, sectie):
#         def creator():
#     def get_perceel_by_id_and_sectie(self, id, sectie):
#         def creator():
#     def _get_perceel_by(self, url, cache_key):
#         def creator():
#     def get_perceel_by_capakey(self, capakey):
#     def get_perceel_by_coordinates(self, x, y):
#     def get_perceel_by_percid(self, percid):
#     def __init__(self, **kwargs):
#     def set_gateway(self, gateway):
#     def clear_gateway(self):
#     def check_gateway(self):
#     def __str__(self):
# def check_lazy_load_gemeente(f):
#     def wrapper(self):
#     def __init__(
#         self, id, naam=None,
#         centroid=None, bounding_box=None,
#         shape=None, **kwargs
#     ):
#     def naam(self):
#     def centroid(self):
#     def bounding_box(self):
#     def afdelingen(self):
#     def __unicode__(self):
#     def __repr__(self):
# def check_lazy_load_afdeling(f):
#     def wrapper(self):
#     def __init__(
#         self, id, naam=None, gemeente=None,
#         centroid=None, bounding_box=None,
#         shape=None, **kwargs
#     ):
#     def set_gateway(self, gateway):
#     def clear_gateway(self):
#     def naam(self):
#     def gemeente(self):
#     def centroid(self):
#     def bounding_box(self):
#     def secties(self):
#     def __unicode__(self):
#     def __repr__(self):
# def check_lazy_load_sectie(f):
#     def wrapper(self):
#     def __init__(
#         self, id, afdeling,
#         centroid=None, bounding_box=None,
#         shape=None, **kwargs
#     ):
#     def set_gateway(self, gateway):
#     def clear_gateway(self):
#     def centroid(self):
#     def bounding_box(self):
#     def percelen(self):
#     def __unicode__(self):
#     def __repr__(self):
# def check_lazy_load_perceel(f):
#     def wrapper(self):
#     def __init__(
#         self, id, sectie, capakey, percid, adres=None,
#         capatype=None, cashkey=None,
#         centroid=None, bounding_box=None,
#         shape=None, **kwargs
#     ):
#     def set_gateway(self, gateway):
#     def clear_gateway(self):
#     def get_percid_from_capakey(capakey):
#     def get_capakey_from_percid(percid):
#     def _split_capakey(self):
#     def centroid(self):
#     def bounding_box(self):
#     def capatype(self):
#     def cashkey(self):
#     def __unicode__(self):
#     def __repr__(self):
# class CapakeyRestGateway:
# class GatewayObject:
# class Gemeente(GatewayObject):
# class Afdeling(GatewayObject):
# class Sectie(GatewayObject):
# class Perceel(GatewayObject):


import re
    import unittest2 as unittest
    import unittest  # noqa
import pytest
import requests
from tests.conftest import CAPAKEY_URL
from crabpy.gateway.capakey import (
    Gemeente,
    Afdeling,
    Sectie,
    Perceel,
    capakey_rest_gateway_request,
    GatewayRuntimeException
)
    from unittest.mock import MagicMock, patch
    from unittest.mock import MagicMock, patch
        from crabpy.gateway.exception import GatewayResourceNotFoundException
            44021,
            'GENT  1 AFD',
            Gemeente(44021, 'Gent'),
        )
        assert a.id == 44021
        assert a.naam == 'GENT  1 AFD'
        assert 'GENT  1 AFD (44021)' == str(a)
        assert "Afdeling(44021, 'GENT  1 AFD')" == repr(a)

    def test_to_string_not_fully_initialised(self):
        a = Afdeling(
            44021
        )
        assert 'Afdeling 44021' == str(a)

    def test_check_gateway_not_set(self):
        a = Afdeling(44021)
        with pytest.raises(RuntimeError):
            a.check_gateway()

    def test_lazy_load(self, capakey_rest_gateway, department_response):
        a = Afdeling(44021)
        a.set_gateway(capakey_rest_gateway)
        assert a.id == 44021
        assert a.naam == 'GENT  1 AFD'
        assert not a.centroid == None
        assert not a.bounding_box == None

    def test_secties(self, capakey_rest_gateway, department_response,
                     department_sections_response):

# Path: tests/conftest.py
# CAPAKEY_URL = 'https://geoservices.informatievlaanderen.be/capakey/api/v2'
# 
# Path: crabpy/gateway/capakey.py
# def capakey_rest_gateway_request(url, headers={}, params={}):
#     def __init__(self, **kwargs):
#     def _parse_centroid(center):
#     def _parse_bounding_box(bounding_box):
#     def list_gemeenten(self, sort=1):
#         def creator():
#     def get_gemeente_by_id(self, id):
#         def creator():
#     def list_kadastrale_afdelingen(self):
#         def creator():
#     def list_kadastrale_afdelingen_by_gemeente(self, gemeente, sort=1):
#         def creator():
#     def get_kadastrale_afdeling_by_id(self, aid):
#         def creator():
#     def list_secties_by_afdeling(self, afdeling):
#         def creator():
#     def get_sectie_by_id_and_afdeling(self, id, afdeling):
#         def creator():
#     def parse_percid(self, capakey):
#     def parse_capakey(self, percid):
#     def list_percelen_by_sectie(self, sectie):
#         def creator():
#     def get_perceel_by_id_and_sectie(self, id, sectie):
#         def creator():
#     def _get_perceel_by(self, url, cache_key):
#         def creator():
#     def get_perceel_by_capakey(self, capakey):
#     def get_perceel_by_coordinates(self, x, y):
#     def get_perceel_by_percid(self, percid):
#     def __init__(self, **kwargs):
#     def set_gateway(self, gateway):
#     def clear_gateway(self):
#     def check_gateway(self):
#     def __str__(self):
# def check_lazy_load_gemeente(f):
#     def wrapper(self):
#     def __init__(
#         self, id, naam=None,
#         centroid=None, bounding_box=None,
#         shape=None, **kwargs
#     ):
#     def naam(self):
#     def centroid(self):
#     def bounding_box(self):
#     def afdelingen(self):
#     def __unicode__(self):
#     def __repr__(self):
# def check_lazy_load_afdeling(f):
#     def wrapper(self):
#     def __init__(
#         self, id, naam=None, gemeente=None,
#         centroid=None, bounding_box=None,
#         shape=None, **kwargs
#     ):
#     def set_gateway(self, gateway):
#     def clear_gateway(self):
#     def naam(self):
#     def gemeente(self):
#     def centroid(self):
#     def bounding_box(self):
#     def secties(self):
#     def __unicode__(self):
#     def __repr__(self):
# def check_lazy_load_sectie(f):
#     def wrapper(self):
#     def __init__(
#         self, id, afdeling,
#         centroid=None, bounding_box=None,
#         shape=None, **kwargs
#     ):
#     def set_gateway(self, gateway):
#     def clear_gateway(self):
#     def centroid(self):
#     def bounding_box(self):
#     def percelen(self):
#     def __unicode__(self):
#     def __repr__(self):
# def check_lazy_load_perceel(f):
#     def wrapper(self):
#     def __init__(
#         self, id, sectie, capakey, percid, adres=None,
#         capatype=None, cashkey=None,
#         centroid=None, bounding_box=None,
#         shape=None, **kwargs
#     ):
#     def set_gateway(self, gateway):
#     def clear_gateway(self):
#     def get_percid_from_capakey(capakey):
#     def get_capakey_from_percid(percid):
#     def _split_capakey(self):
#     def centroid(self):
#     def bounding_box(self):
#     def capatype(self):
#     def cashkey(self):
#     def __unicode__(self):
#     def __repr__(self):
# class CapakeyRestGateway:
# class GatewayObject:
# class Gemeente(GatewayObject):
# class Afdeling(GatewayObject):
# class Sectie(GatewayObject):
# class Perceel(GatewayObject):


# Path: tests/gateway/test_capakey.py
import re
    import unittest2 as unittest
    import unittest  # noqa
import pytest
import requests
from tests.conftest import CAPAKEY_URL
from crabpy.gateway.capakey import (
    Gemeente,
    Afdeling,
    Sectie,
    Perceel,
    capakey_rest_gateway_request,
    GatewayRuntimeException
)
    from unittest.mock import MagicMock, patch
    from unittest.mock import MagicMock, patch
        from crabpy.gateway.exception import GatewayResourceNotFoundException

            44021,
            'GENT  1 AFD',
            Gemeente(44021, 'Gent'),
        )
        assert a.id == 44021
        assert a.naam == 'GENT  1 AFD'
        assert 'GENT  1 AFD (44021)' == str(a)
        assert "Afdeling(44021, 'GENT  1 AFD')" == repr(a)

    def test_to_string_not_fully_initialised(self):
        a = Afdeling(
            44021
        )
        assert 'Afdeling 44021' == str(a)

    def test_check_gateway_not_set(self):
        a = Afdeling(44021)
        with pytest.raises(RuntimeError):
            a.check_gateway()

    def test_lazy_load(self, capakey_rest_gateway, department_response):
        a = Afdeling(44021)
        a.set_gateway(capakey_rest_gateway)
        assert a.id == 44021
        assert a.naam == 'GENT  1 AFD'
        assert not a.centroid == None
        assert not a.bounding_box == None

    def test_secties(self, capakey_rest_gateway, department_response,
                     department_sections_response):

        a = Afdeling(44021)