File: test_charset.py

package info (click to toggle)
python-geoip 1.3.2-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 344 kB
  • sloc: ansic: 753; python: 248; makefile: 5
file content (14 lines) | stat: -rw-r--r-- 377 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# -*- coding: utf-8 -*-

import GeoIP
from nose.tools import assert_equal


def test_charset():
    gi = GeoIP.open("tests/data/GeoIPOrg.dat", GeoIP.GEOIP_STANDARD)

    gi.set_charset(GeoIP.GEOIP_CHARSET_UTF8)
    assert_equal(gi.charset(), GeoIP.GEOIP_CHARSET_UTF8)

    assert_equal(gi.name_by_addr("142.217.214.0"),
                 'LINO Solutions Internet de Télébec')