3
0
Fork 0

fix: add mechanism to discover external wutta subcommands

for sake of wuttasync, e.g. `wutta import-csv`
This commit is contained in:
Lance Edgar 2024-12-05 18:58:10 -06:00
parent 3a1ea22e9b
commit a9eebc682e
3 changed files with 53 additions and 2 deletions

View file

@ -2,7 +2,7 @@
import os
from unittest import TestCase
from unittest.mock import MagicMock
from unittest.mock import MagicMock, patch
import typer
@ -32,6 +32,15 @@ class TestTyperCallback(TestCase):
self.assertEqual(ctx.wutta_config.files_read, [example_conf])
class TestTyperEagerImports(TestCase):
def test_basic(self):
typr = mod.make_typer(name='foobreezy')
with patch.object(mod, 'load_entry_points') as load_entry_points:
mod.typer_eager_imports(typr)
load_entry_points.assert_called_once_with('foobreezy.typer_imports')
class TestMakeTyper(TestCase):
def test_basic(self):