25 lines
785 B
Python
25 lines
785 B
Python
#-*- coding: utf-8; -*-
|
|
|
|
import os
|
|
from unittest import TestCase
|
|
from unittest.mock import MagicMock, patch
|
|
|
|
from wuttasync.cli import import_csv as mod
|
|
from wuttasync.importing.csv import FromCsvToWutta
|
|
|
|
|
|
here = os.path.dirname(__file__)
|
|
example_conf = os.path.join(here, 'example.conf')
|
|
|
|
|
|
class TestImportCsv(TestCase):
|
|
|
|
def test_basic(self):
|
|
ctx = MagicMock(params={'models': [],
|
|
'create': True, 'update': True, 'delete': False,
|
|
'dry_run': True})
|
|
with patch.object(FromCsvToWutta, 'process_data') as process_data:
|
|
mod.import_csv(ctx)
|
|
process_data.assert_called_once_with(create=True, update=True, delete=False,
|
|
dry_run=True)
|