cli2 3.3.33__tar.gz → 3.3.35__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-3.3.33/cli2.egg-info → cli2-3.3.35}/PKG-INFO +1 -1
- {cli2-3.3.33 → cli2-3.3.35}/cli2/client.py +6 -1
- {cli2-3.3.33 → cli2-3.3.35}/cli2/test_client.py +12 -0
- {cli2-3.3.33 → cli2-3.3.35/cli2.egg-info}/PKG-INFO +1 -1
- {cli2-3.3.33 → cli2-3.3.35}/setup.py +1 -1
- {cli2-3.3.33 → cli2-3.3.35}/MANIFEST.in +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/README.rst +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/classifiers.txt +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/__init__.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/argument.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/asyncio.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/cli.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/colors.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/command.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/configuration.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/decorators.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/display.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/entry_point.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/example_client.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/example_client_complex.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/example_nesting.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/example_obj.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/group.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/logging.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/node.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/overrides.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/sphinx.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/table.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/test.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/test_cli.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/test_command.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/test_configuration.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/test_decorators.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/test_display.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/test_entry_point.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/test_group.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/test_inject.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/test_node.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2/test_table.py +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2.egg-info/SOURCES.txt +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2.egg-info/dependency_links.txt +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2.egg-info/entry_points.txt +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2.egg-info/requires.txt +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/cli2.egg-info/top_level.txt +0 -0
- {cli2-3.3.33 → cli2-3.3.35}/setup.cfg +0 -0
|
@@ -715,7 +715,9 @@ class ModelMetaclass(type):
|
|
|
715
715
|
client_class.models.append(cls)
|
|
716
716
|
client_cli = getattr(client_class, 'cli', None)
|
|
717
717
|
if client_cli:
|
|
718
|
-
|
|
718
|
+
group = ModelGroup(cls)
|
|
719
|
+
if len(group) > 1:
|
|
720
|
+
cls.cli = client_cli[cls.__name__.lower()] = group
|
|
719
721
|
|
|
720
722
|
cls._fields = dict()
|
|
721
723
|
|
|
@@ -1434,6 +1436,9 @@ class Client(metaclass=ClientMetaclass):
|
|
|
1434
1436
|
if not self.token and not self.token_getting:
|
|
1435
1437
|
await self.token_refresh()
|
|
1436
1438
|
|
|
1439
|
+
if not accepts and os.getenv('STRICT'):
|
|
1440
|
+
raise Exception('Accepts not set')
|
|
1441
|
+
|
|
1437
1442
|
if handler is None:
|
|
1438
1443
|
if accepts or refuses or tries or backoff:
|
|
1439
1444
|
# if any handler kwarg, clone our handler and override
|
|
@@ -51,6 +51,18 @@ async def test_client_cli(client_class, httpx_mock):
|
|
|
51
51
|
httpx_mock.add_response(url='http://lol/', json=[dict(a=1)])
|
|
52
52
|
await client_class.cli['testmodel']['find'].async_call()
|
|
53
53
|
|
|
54
|
+
class TestModel2(client_class.Model):
|
|
55
|
+
pass
|
|
56
|
+
|
|
57
|
+
assert 'testmodel2' not in client_class.cli
|
|
58
|
+
|
|
59
|
+
class TestModel3(client_class.Model):
|
|
60
|
+
@cli2.cmd
|
|
61
|
+
def find():
|
|
62
|
+
pass
|
|
63
|
+
|
|
64
|
+
assert list(client_class.cli['testmodel3'].keys()) == ['help', 'find']
|
|
65
|
+
|
|
54
66
|
|
|
55
67
|
@pytest.mark.asyncio
|
|
56
68
|
async def test_client_cli_override(client_class, httpx_mock):
|
|
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
|