move add-data subcommand into a separate file

This commit is contained in:
Sarah Hoffmann
2021-07-25 18:14:12 +02:00
parent 8096a1d67f
commit 878835e4bd
4 changed files with 71 additions and 60 deletions

View File

@@ -60,7 +60,6 @@ class TestCli:
@pytest.mark.parametrize("command,script", [
(('add-data', '--file', 'foo.osm'), 'update'),
(('export',), 'export')
])
def test_legacy_commands_simple(self, mock_run_legacy, command, script):
@@ -90,7 +89,8 @@ class TestCli:
@pytest.mark.parametrize("name,oid", [('file', 'foo.osm'), ('diff', 'foo.osc'),
('node', 12), ('way', 8), ('relation', 32)])
def test_add_data_command(self, mock_run_legacy, name, oid):
def test_add_data_command(self, mock_func_factory, name, oid):
mock_run_legacy = mock_func_factory(nominatim.clicmd.add_data, 'run_legacy_script')
assert self.call_nominatim('add-data', '--' + name, str(oid)) == 0
assert mock_run_legacy.called == 1