wuttasync/tests/cli/test_import_wutta.py

24 lines
612 B
Python
Raw Normal View History

# -*- coding: utf-8; -*-
from unittest import TestCase
from unittest.mock import MagicMock, patch
from wuttasync.cli import import_wutta as mod, ImportCommandHandler
class TestImportWutta(TestCase):
def test_basic(self):
params = {
"dbkey": "another",
"models": [],
"create": True,
"update": True,
"delete": False,
"dry_run": True,
}
ctx = MagicMock(params=params)
with patch.object(ImportCommandHandler, "run") as run:
mod.import_wutta(ctx)
run.assert_called_once_with(ctx)