cli2 5.1.2__tar.gz → 5.1.5__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-5.1.2/cli2.egg-info → cli2-5.1.5}/PKG-INFO +1 -1
- {cli2-5.1.2 → cli2-5.1.5}/cli2/cli.py +5 -0
- {cli2-5.1.2 → cli2-5.1.5/cli2.egg-info}/PKG-INFO +1 -1
- {cli2-5.1.2 → cli2-5.1.5}/setup.py +1 -1
- {cli2-5.1.2 → cli2-5.1.5}/tests/test_client.py +27 -0
- {cli2-5.1.2 → cli2-5.1.5}/tests/test_client_test.py +0 -1
- {cli2-5.1.2 → cli2-5.1.5}/tests/test_command.py +2 -0
- {cli2-5.1.2 → cli2-5.1.5}/MANIFEST.in +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/README.rst +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/classifiers.txt +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/cli2/__init__.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/cli2/asyncio.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/cli2/cli2.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/cli2/colors.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/cli2/configuration.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/cli2/decorators.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/cli2/display.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/cli2/examples/__init__.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/cli2/examples/conf.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/cli2/examples/example.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/cli2/examples/example_obj.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/cli2/examples/nesting.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/cli2/examples/obj.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/cli2/examples/obj2.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/cli2/examples/test.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/cli2/lock.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/cli2/log.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/cli2/mask.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/cli2/node.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/cli2/sphinx.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/cli2/table.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/cli2/test.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/cli2.egg-info/SOURCES.txt +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/cli2.egg-info/dependency_links.txt +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/cli2.egg-info/entry_points.txt +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/cli2.egg-info/requires.txt +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/cli2.egg-info/top_level.txt +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/setup.cfg +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/tests/test_ansible.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/tests/test_ansible_variables.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/tests/test_asyncio.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/tests/test_cli.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/tests/test_configuration.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/tests/test_decorators.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/tests/test_display.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/tests/test_entry_point.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/tests/test_group.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/tests/test_inject.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/tests/test_lock.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/tests/test_log.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/tests/test_mask.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/tests/test_node.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/tests/test_restful.py +0 -0
- {cli2-5.1.2 → cli2-5.1.5}/tests/test_table.py +0 -0
|
@@ -442,6 +442,11 @@ class Command(EntryPoint, dict):
|
|
|
442
442
|
def sig(self):
|
|
443
443
|
return inspect.signature(self.target)
|
|
444
444
|
|
|
445
|
+
def __delitem__(self, key):
|
|
446
|
+
if key in self.positions:
|
|
447
|
+
del self.positions[key]
|
|
448
|
+
return super().__delitem__(key)
|
|
449
|
+
|
|
445
450
|
def __getitem__(self, key):
|
|
446
451
|
self._setargs()
|
|
447
452
|
return super().__getitem__(key)
|
|
@@ -1328,3 +1328,30 @@ def test_field_callback_recursion(client_class):
|
|
|
1328
1328
|
|
|
1329
1329
|
model = client_class().TestModel(req1='lol')
|
|
1330
1330
|
assert model.final == 'lolval2val3'
|
|
1331
|
+
|
|
1332
|
+
|
|
1333
|
+
def test_virtual(client_class):
|
|
1334
|
+
class TestModel(client_class.Model):
|
|
1335
|
+
virt = chttpx.VirtualField()
|
|
1336
|
+
real = chttpx.Field()
|
|
1337
|
+
|
|
1338
|
+
@real.factory(virt)
|
|
1339
|
+
def real_factory(self):
|
|
1340
|
+
return f'remote-{self.virt}'
|
|
1341
|
+
|
|
1342
|
+
|
|
1343
|
+
model = client_class().TestModel(virt='foo')
|
|
1344
|
+
assert model.virt == 'foo'
|
|
1345
|
+
assert model._data_virtual == dict(virt='foo')
|
|
1346
|
+
assert 'virt' not in model.data
|
|
1347
|
+
|
|
1348
|
+
# using the virtual field to generate a remote value
|
|
1349
|
+
assert model.real == 'remote-foo'
|
|
1350
|
+
|
|
1351
|
+
# setting an actual new value
|
|
1352
|
+
model.real = 'new-real'
|
|
1353
|
+
assert model.real == 'new-real'
|
|
1354
|
+
|
|
1355
|
+
# setting the virtual field does not affect present values
|
|
1356
|
+
model.virt = 'bar'
|
|
1357
|
+
assert model.real == 'new-real'
|
|
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
|