]>
git.ipfire.org Git - location/libloc.git/blob - tests/python/test-export.py
cef87b3a2773e8c956de4baeaa983c6aa0c1a9c0
2 ###############################################################################
4 # libloc - A library to determine the location of someone on the Internet #
6 # Copyright (C) 2022 IPFire Development Team <info@ipfire.org> #
8 # This library is free software; you can redistribute it and/or #
9 # modify it under the terms of the GNU Lesser General Public #
10 # License as published by the Free Software Foundation; either #
11 # version 2.1 of the License, or (at your option) any later version. #
13 # This library is distributed in the hope that it will be useful, #
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU #
16 # Lesser General Public License for more details. #
18 ###############################################################################
24 TEST_DATA_DIR
= os
.environ
["TEST_DATA_DIR"]
26 class Test(unittest
.TestCase
):
28 path
= os
.path
.join(TEST_DATA_DIR
, "location-2022-03-30.db")
31 self
.db
= location
.Database(path
)
33 def test_list_networks(self
):
35 Lists all available networks
37 for network
in self
.db
.networks
:
40 def test_list_networks_flattened(self
):
42 Lists all networks but flattened
44 for network
in self
.db
.networks_flattened
:
48 if __name__
== "__main__":