Пример #1
0
def test_frenchmaps():
    datas = {}
    for dept in DEPARTMENTS.keys():
        datas[dept] = int(''.join([x for x in dept if x.isdigit()])) * 10

    fmap = FrenchMap_Departments()
    fmap.add('departements', datas)
    q = fmap.render_pyquery()
    assert len(
        q('#departements .departement,#dom-com .departement')
    ) == len(DEPARTMENTS)

    fmap = FrenchMap_Regions()
    fmap.add('regions', aggregate_regions(datas))
    q = fmap.render_pyquery()
    assert len(q('#regions .region,#dom-com .region')) == len(REGIONS)

    assert aggregate_regions(datas.items()) == aggregate_regions(datas)
Пример #2
0
    def test_frenchmapdepartments():
        fmap = FrenchMap_Departments(style=choice(list(styles.values())))
        for i in range(10):
            fmap.add("s%d" % i, [(choice(list(DEPARTMENTS.keys())), randint(0, 100)) for _ in range(randint(1, 5))])

        fmap.add(
            "links",
            [
                {"value": ("69", 10), "label": "\o/", "xlink": "http://google.com?q=69"},
                {"value": ("42", 20), "label": "Y"},
            ],
        )
        fmap.add("6th", [3, 5, 34, 12])
        fmap.title = "French map"
        return fmap.render_response()
Пример #3
0
    def test_frenchmapdepartments():
        fmap = FrenchMap_Departments(style=choice(list(styles.values())))
        for i in range(10):
            fmap.add('s%d' % i, [
                (choice(list(DEPARTMENTS.keys())), randint(0, 100)) for _ in range(randint(1, 5))])

        fmap.add('links', [{
            'value': ('69', 10),
            'label': '\o/',
            'xlink': 'http://google.com?q=69'
        }, {
            'value': ('42', 20),
            'label': 'Y',
        }])
        fmap.add('6th', [3, 5, 34, 12])
        fmap.title = 'French map'
        return fmap.render_response()
Пример #4
0
    def test_frenchmapdepartments():
        fmap = FrenchMap_Departments(style=choice(list(styles.values())))
        for i in range(10):
            fmap.add('s%d' % i,
                     [(choice(list(DEPARTMENTS.keys())), randint(0, 100))
                      for _ in range(randint(1, 5))])

        fmap.add('links', [{
            'value': ('69', 10),
            'label': '\o/',
            'xlink': 'http://google.com?q=69'
        }, {
            'value': ('42', 20),
            'label': 'Y',
        }])
        fmap.add('6th', [3, 5, 34, 12])
        fmap.title = 'French map'
        return fmap.render_response()