Commit 543de9e2 authored by Jgiannelos's avatar Jgiannelos
Browse files

Move tileset deduplication to dedicated module

parent 7eb20e24
...@@ -14,6 +14,6 @@ setup( ...@@ -14,6 +14,6 @@ setup(
packages=find_packages(include=["wmfmaps.*"]), packages=find_packages(include=["wmfmaps.*"]),
python_requires=">=3.7", python_requires=">=3.7",
entry_points={ entry_points={
"console_scripts": ["maps-deduped-tilelist=tileset.cli:main"], "console_scripts": ["maps-deduped-tilelist=wmfmaps.tileset.cli:main"],
}, },
) )
...@@ -2,7 +2,7 @@ from argparse import Namespace ...@@ -2,7 +2,7 @@ from argparse import Namespace
from io import StringIO from io import StringIO
from unittest import TestCase, mock from unittest import TestCase, mock
from tileset.cli import main from wmfmaps.tileset.cli import main
class CliTest(TestCase): class CliTest(TestCase):
...@@ -16,7 +16,9 @@ class CliTest(TestCase): ...@@ -16,7 +16,9 @@ class CliTest(TestCase):
test_input_file.write(test_input) test_input_file.write(test_input)
test_input_file.seek(0) test_input_file.seek(0)
with mock.patch("tileset.cli.argparse.ArgumentParser.parse_args") as parse_args: with mock.patch(
"wmfmaps.tileset.cli.argparse.ArgumentParser.parse_args"
) as parse_args:
parse_args.return_value = Namespace( parse_args.return_value = Namespace(
tilelist_file=test_input_file, minzoom=0, maxzoom=1 tilelist_file=test_input_file, minzoom=0, maxzoom=1
) )
......
from io import StringIO from io import StringIO
from unittest import TestCase, mock from unittest import TestCase, mock
from tileset import Tile, TileSet from wmfmaps.tileset import Tile, TileSet
class TestTile(TestCase): class TestTile(TestCase):
...@@ -18,8 +18,8 @@ class TestTile(TestCase): ...@@ -18,8 +18,8 @@ class TestTile(TestCase):
class TestTileSet(TestCase): class TestTileSet(TestCase):
@mock.patch("tileset.TileSet.addChildren") @mock.patch("wmfmaps.tileset.TileSet.addChildren")
@mock.patch("tileset.TileSet.addParent") @mock.patch("wmfmaps.tileset.TileSet.addParent")
def test_tileset_read(self, mock_addParent, mock_addChildren): def test_tileset_read(self, mock_addParent, mock_addChildren):
test_input = ["15/5/5", "15/12/12"] test_input = ["15/5/5", "15/12/12"]
test_input = "\n".join(test_input) test_input = "\n".join(test_input)
......
import argparse import argparse
import sys import sys
from tileset import TileSet from wmfmaps.tileset import TileSet
def main(): def main():
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment