How to use the zat.utils.geo_lookup.GeoLookup function in zat

To help you get started, we’ve selected a few zat examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SuperCowPowers / zat / zat / utils / geo_lookup.py View on Github external
def test():
    """geo_lookup.py test"""

    # Execute the worker (unit test)
    geo_lookup = GeoLookup(summary=False)
    output = geo_lookup.query_ip('73.26.145.66')
    print('\n<<< Unit Test FULL>>>')
    pprint.pprint(output)

    geo_lookup = GeoLookup()
    output = geo_lookup.query_ip('73.26.145.66')
    print('\n<<< Unit Test Summary>>>')
    pprint.pprint(output)
    output = geo_lookup.query_ip('123.4.5.6')
    print('\n<<< Unit Test Summary>>>')
    pprint.pprint(output)

    # Test Cache
    output = geo_lookup.query_ip('73.26.145.66')
    print('\n<<< Unit Test Cache>>>')
    pprint.pprint(output)
github SuperCowPowers / zat / zat / utils / geo_lookup.py View on Github external
def test():
    """geo_lookup.py test"""

    # Execute the worker (unit test)
    geo_lookup = GeoLookup(summary=False)
    output = geo_lookup.query_ip('73.26.145.66')
    print('\n<<< Unit Test FULL>>>')
    pprint.pprint(output)

    geo_lookup = GeoLookup()
    output = geo_lookup.query_ip('73.26.145.66')
    print('\n<<< Unit Test Summary>>>')
    pprint.pprint(output)
    output = geo_lookup.query_ip('123.4.5.6')
    print('\n<<< Unit Test Summary>>>')
    pprint.pprint(output)

    # Test Cache
    output = geo_lookup.query_ip('73.26.145.66')
    print('\n<<< Unit Test Cache>>>')
    pprint.pprint(output)

    # Test Size
    assert geo_lookup.size == 2

    # Test some error conditions