Ejemplo n.º 1
0
 def test_override_wsdl(self, request):
     wsdl = "http://ws.agiv.be/capakeyws/nodataset.asmx?WSDL"
     self.capakey = capakey_factory(
         wsdl=wsdl,
         user=request.config.getoption('--capakey-soap-user'),
         password=request.config.getoption('--capakey-soap-password'))
     assert self.capakey.wsdl.url == wsdl
Ejemplo n.º 2
0
def capakey(request):
    if not request.config.getoption('--capakey-soap-integration'):
        return None
    from crabpy.client import capakey_factory
    capakey = capakey_factory(
        user=request.config.getoption("--capakey-soap-user"),
        password=request.config.getoption("--capakey-soap-password"))
    return capakey
Ejemplo n.º 3
0
 def test_override_wsdl(self):
     from testconfig import config
     wsdl = "http://ws.agiv.be/capakeyws/nodataset.asmx?WSDL"
     self.capakey = capakey_factory(
         wsdl=wsdl,
         user=config['capakey']['user'],
         password=config['capakey']['password']
     )
     self.assertEqual(self.capakey.wsdl.url, wsdl)
Ejemplo n.º 4
0
 def setUp(self):
     from testconfig import config
     self.capakey_client = capakey_factory(
         user=config['capakey']['user'],
         password=config['capakey']['password']
     )
     self.capakey = CapakeyGateway(
         self.capakey_client
     )
Ejemplo n.º 5
0
 def test_list_gemeenten_invalid_auth(self):
     self.capakey_client = capakey_factory(
         user='******',
         password='******'
     )
     self.capakey = CapakeyGateway(
         self.capakey_client
     )
     from crabpy.gateway.exception import GatewayAuthenticationException
     with self.assertRaises(GatewayAuthenticationException):
         self.capakey.list_gemeenten()
Ejemplo n.º 6
0
 def test_secties(self):
     from testconfig import config
     capakey = CapakeyGateway(
         capakey_factory(
             user=config['capakey']['user'],
             password=config['capakey']['password']
         )
     )
     a = Afdeling(44021)
     a.set_gateway(capakey)
     secties = a.secties
     self.assertIsInstance(secties, list)
     self.assertEqual(len(secties), 1)
Ejemplo n.º 7
0
 def test_afdelingen(self):
     from testconfig import config
     capakey = CapakeyGateway(
         capakey_factory(
             user=config['capakey']['user'],
             password=config['capakey']['password']
         )
     )
     g = Gemeente(44021)
     g.set_gateway(capakey)
     afdelingen = g.afdelingen
     self.assertIsInstance(afdelingen, list)
     self.assertGreater(len(afdelingen), 0)
     self.assertLess(len(afdelingen), 40)
Ejemplo n.º 8
0
 def test_lazy_load(self):
     from testconfig import config
     capakey = CapakeyGateway(
         capakey_factory(
             user=config['capakey']['user'],
             password=config['capakey']['password']
         )
     )
     a = Afdeling(44021)
     a.set_gateway(capakey)
     self.assertEqual(a.id, 44021)
     self.assertEqual(a.naam, 'GENT  1 AFD')
     self.assertIsNotNone(a.centroid)
     self.assertIsNotNone(a.bounding_box)
Ejemplo n.º 9
0
 def test_lazy_load(self):
     from testconfig import config
     capakey = CapakeyGateway(
         capakey_factory(
             user=config['capakey']['user'],
             password=config['capakey']['password']
         )
     )
     g = Gemeente(44021)
     g.set_gateway(capakey)
     self.assertEqual(g.id, 44021)
     self.assertEqual(g.naam, 'Gent')
     self.assertIsNotNone(g.centroid)
     self.assertIsNotNone(g.bounding_box)
Ejemplo n.º 10
0
 def test_percelen(self):
     from testconfig import config
     capakey = CapakeyGateway(
         capakey_factory(
             user=config['capakey']['user'],
             password=config['capakey']['password']
         )
     )
     s = Sectie(
         'A',
         Afdeling(44021)
     )
     s.set_gateway(capakey)
     percelen = s.percelen
     self.assertIsInstance(percelen, list)
     self.assertGreater(len(percelen), 0)
Ejemplo n.º 11
0
 def test_lazy_load(self):
     from testconfig import config
     capakey = CapakeyGateway(
         capakey_factory(
             user=config['capakey']['user'],
             password=config['capakey']['password']
         )
     )
     s = Sectie(
         'A',
         Afdeling(44021)
     )
     s.set_gateway(capakey)
     self.assertEqual(s.id, 'A')
     self.assertEqual(s.afdeling.id, 44021)
     self.assertIsNotNone(s.centroid)
     self.assertIsNotNone(s.bounding_box)
Ejemplo n.º 12
0
 def setUp(self):
     from testconfig import config
     self.capakey_client = capakey_factory(
         user=config['capakey']['user'],
         password=config['capakey']['password']
     )
     self.capakey = CapakeyGateway(
         self.capakey_client,
         cache_config = {
             'permanent.backend': 'dogpile.cache.memory',
             'permanent.expiration_time': 86400,
             'long.backend': 'dogpile.cache.memory',
             'long.expiration_time': 3600,
             'short.backend': 'dogpile.cache.memory',
             'short.expiration_time': 600,
         }
     )
Ejemplo n.º 13
0
 def test_lazy_load(self):
     from testconfig import config
     capakey = CapakeyGateway(
         capakey_factory(
             user=config['capakey']['user'],
             password=config['capakey']['password']
         )
     )
     p = Perceel(
         '1154/02C000', Sectie('A', Afdeling(46013)),
         '40613A1154/02C000', '40613_A_1154_C_000_02',
         gateway=capakey
     )
     self.assertEqual(p.id, '1154/02C000')
     self.assertEqual(p.sectie.id, 'A')
     self.assertEqual(p.sectie.afdeling.id, 46013)
     self.assertIsNotNone(p.centroid)
     self.assertIsNotNone(p.bounding_box)
Ejemplo n.º 14
0
# -*- coding: utf-8 -*-
"""
This script demonstrates using the capakey gateway to walk the entire
cadastral tree of a `gemeente`.

WARNING: The CapakeyGateway (SOAP) is deprecated, use CapakeyRestGateway (REST) instead.
"""

from crabpy.client import capakey_factory

capakey = capakey_factory(
    user = '******',
    password = '******'
)

from crabpy.gateway.capakey import CapakeyGateway

g = CapakeyGateway(capakey)

gemeente = g.get_gemeente_by_id(45062)

print(str(gemeente))
for a in gemeente.afdelingen:
    print("* %s" % a)
    for s in a.secties:
        print("\t* %s" % s)
        for p in s.percelen:
            print("\t\t* %s" % p)
Ejemplo n.º 15
0
# -*- coding: utf-8 -*-
"""
This script demonstrates using the capakey gateway to walk the entire
cadastral tree of a `gemeente`.

WARNING: The CapakeyGateway (SOAP) is deprecated, use CapakeyRestGateway (REST) instead.
"""

from crabpy.client import capakey_factory

capakey = capakey_factory(user='******', password='******')

from crabpy.gateway.capakey import CapakeyGateway

g = CapakeyGateway(capakey)

gemeente = g.get_gemeente_by_id(45062)

print(str(gemeente))
for a in gemeente.afdelingen:
    print("* %s" % a)
    for s in a.secties:
        print("\t* %s" % s)
        for p in s.percelen:
            print("\t\t* %s" % p)
Ejemplo n.º 16
0
 def test_user_and_password_must_be_set(self):
     with pytest.raises(ValueError):
         capakey_factory()
Ejemplo n.º 17
0
 def setUp(self):
     from testconfig import config
     self.capakey = capakey_factory(
         user=config['capakey']['user'],
         password=config['capakey']['password']
     )