cli2 4.3.3__tar.gz → 4.3.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cli2-4.3.3/cli2.egg-info → cli2-4.3.4}/PKG-INFO +1 -1
- {cli2-4.3.3 → cli2-4.3.4}/cli2/client.py +4 -2
- {cli2-4.3.3 → cli2-4.3.4/cli2.egg-info}/PKG-INFO +1 -1
- {cli2-4.3.3 → cli2-4.3.4}/setup.py +1 -1
- {cli2-4.3.3 → cli2-4.3.4}/tests/test_client.py +8 -0
- {cli2-4.3.3 → cli2-4.3.4}/MANIFEST.in +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/README.rst +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/classifiers.txt +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2/__init__.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2/ansible/__init__.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2/ansible/action.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2/ansible/playbook.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2/ansible/variables.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2/asyncio.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2/cli.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2/cli2.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2/colors.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2/configuration.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2/decorators.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2/display.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2/examples/__init__.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2/examples/client.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2/examples/conf.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2/examples/example.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2/examples/example_obj.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2/examples/nesting.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2/examples/obj.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2/examples/obj2.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2/examples/test.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2/lock.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2/log.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2/mask.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2/node.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2/sphinx.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2/table.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2/test.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2.egg-info/SOURCES.txt +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2.egg-info/dependency_links.txt +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2.egg-info/entry_points.txt +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2.egg-info/requires.txt +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/cli2.egg-info/top_level.txt +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/setup.cfg +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/tests/test_ansible.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/tests/test_ansible_variables.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/tests/test_asyncio.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/tests/test_cli.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/tests/test_command.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/tests/test_configuration.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/tests/test_decorators.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/tests/test_display.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/tests/test_entry_point.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/tests/test_group.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/tests/test_inject.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/tests/test_lock.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/tests/test_mask.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/tests/test_node.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/tests/test_restful.py +0 -0
- {cli2-4.3.3 → cli2-4.3.4}/tests/test_table.py +0 -0
|
@@ -1287,13 +1287,15 @@ class ClientCommand(Command):
|
|
|
1287
1287
|
:py:meth:`Client.setargs`.
|
|
1288
1288
|
"""
|
|
1289
1289
|
super().setargs()
|
|
1290
|
-
|
|
1290
|
+
if 'self' in self:
|
|
1291
|
+
self['self'].factory = self.client_class.factory
|
|
1291
1292
|
self.client_class.setargs(self)
|
|
1292
1293
|
|
|
1293
1294
|
async def factories_resolve(self):
|
|
1294
1295
|
""" Set :py:attr:`client` after resolving factories. """
|
|
1295
1296
|
await super().factories_resolve()
|
|
1296
|
-
self
|
|
1297
|
+
if 'self' in self:
|
|
1298
|
+
self.client = self['self'].value
|
|
1297
1299
|
|
|
1298
1300
|
async def post_call(self):
|
|
1299
1301
|
""" Call :py:meth:`Client.post_call`. """
|
|
@@ -76,6 +76,14 @@ async def test_client_cli(client_class, httpx_mock):
|
|
|
76
76
|
assert list(client_class.cli['testmodel3'].keys()) == ['help', 'find']
|
|
77
77
|
|
|
78
78
|
|
|
79
|
+
def test_client_cli_func(client_class):
|
|
80
|
+
# test adding a normal function
|
|
81
|
+
@client_class.cli.cmd
|
|
82
|
+
def foo(test):
|
|
83
|
+
pass
|
|
84
|
+
client_class.cli['foo']('bar')
|
|
85
|
+
|
|
86
|
+
|
|
79
87
|
@pytest.mark.asyncio
|
|
80
88
|
async def test_client_cli_override(client_class, httpx_mock):
|
|
81
89
|
class Client(client_class):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|