feat: add support for --runas CLI param, to set versioning authorship
only relevant if Wutta-Continuum is enabled
This commit is contained in:
parent
c6d1822f3b
commit
6ee008e169
8 changed files with 103 additions and 21 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import inspect
|
||||
from unittest import TestCase
|
||||
from unittest.mock import patch
|
||||
from unittest.mock import patch, Mock
|
||||
|
||||
from wuttasync.cli import base as mod
|
||||
from wuttjamaican.testing import DataTestCase
|
||||
|
|
@ -44,12 +44,20 @@ class TestImportCommandHandler(DataTestCase):
|
|||
)
|
||||
|
||||
with patch.object(handler, "list_models") as list_models:
|
||||
handler.run({"list_models": True})
|
||||
list_models.assert_called_once_with({"list_models": True})
|
||||
ctx = Mock(params={"list_models": True})
|
||||
handler.run(ctx)
|
||||
list_models.assert_called_once_with(ctx.params)
|
||||
|
||||
class Object:
|
||||
def __init__(self, **kw):
|
||||
self.__dict__.update(kw)
|
||||
|
||||
with patch.object(handler, "import_handler") as import_handler:
|
||||
handler.run({"models": []})
|
||||
import_handler.process_data.assert_called_once_with()
|
||||
parent = Mock(params={"runas_username": "fred"})
|
||||
# TODO: why can't we just use Mock here? the parent attr is problematic
|
||||
ctx = Object(params={"models": []}, parent=parent)
|
||||
handler.run(ctx)
|
||||
import_handler.process_data.assert_called_once_with(runas_username="fred")
|
||||
|
||||
def test_list_models(self):
|
||||
handler = self.make_handler(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue