wuttasync/tests/cli/test_import_csv.py

20 lines
542 B
Python
Raw Normal View History

2024-12-05 21:19:06 -06:00
#-*- coding: utf-8; -*-
from unittest import TestCase
from unittest.mock import MagicMock, patch
from wuttasync.cli import import_csv as mod, ImportCommandHandler
2024-12-05 21:19:06 -06:00
class TestImportCsv(TestCase):
def test_basic(self):
params = {'models': [],
'create': True, 'update': True, 'delete': False,
'dry_run': True}
ctx = MagicMock(params=params)
with patch.object(ImportCommandHandler, 'run') as run:
2024-12-05 21:19:06 -06:00
mod.import_csv(ctx)
run.assert_called_once_with(params)