+class TestCliReplication:
+
+ @pytest.fixture(autouse=True)
+ def setup_cli_call(self, cli_call, temp_db):
+ self.call_nominatim = lambda *args: cli_call('replication', *args)
+
+ @pytest.mark.parametrize("params,func", [
+ (('--init', '--no-update-functions'), 'init_replication'),
+ (('--check-for-updates',), 'check_for_updates')
+ ])
+ def test_replication_command(self, mock_func_factory, params, func):
+ func_mock = mock_func_factory(nominatim.tools.replication, func)
+
+ assert self.call_nominatim(*params) == 0
+ assert func_mock.called == 1