mirror of
https://github.com/koloideal/Argenta.git
synced 2026-06-10 10:05:28 +03:00
Update documentation and code snippets
This commit is contained in:
@@ -26,13 +26,13 @@ class TestInputCommand(unittest.TestCase):
|
||||
with self.assertRaises(EmptyInputCommandException):
|
||||
InputCommand.parse('')
|
||||
|
||||
def test_validate_valid_input_flag1(self):
|
||||
def test_validate_invalid_input_flag1(self):
|
||||
command = Command('some', flags=Flag('test'))
|
||||
self.assertEqual(command.validate_input_flag(InputFlag('test', input_value=None, status=None)), ValidationStatus.VALID)
|
||||
self.assertEqual(command.validate_input_flag(InputFlag('test', input_value=None, status=None)), ValidationStatus.INVALID)
|
||||
|
||||
def test_validate_valid_input_flag2(self):
|
||||
command = Command('some', flags=Flags([Flag('test'), Flag('more')]))
|
||||
self.assertEqual(command.validate_input_flag(InputFlag('more', input_value=None, status=None)), ValidationStatus.VALID)
|
||||
self.assertEqual(command.validate_input_flag(InputFlag('more', input_value='random-value', status=None)), ValidationStatus.VALID)
|
||||
|
||||
def test_validate_undefined_input_flag1(self):
|
||||
command = Command('some', flags=Flag('test'))
|
||||
@@ -61,4 +61,3 @@ class TestInputCommand(unittest.TestCase):
|
||||
def test_isinstance_parse_correct_raw_command(self):
|
||||
cmd = InputCommand.parse('ssh --host 192.168.0.3')
|
||||
self.assertIsInstance(cmd, InputCommand)
|
||||
|
||||
|
||||
@@ -7,8 +7,7 @@ from argenta.command.flag.flags import Flags, InputFlags
|
||||
from argenta.command.flag.models import PossibleValues, ValidationStatus
|
||||
from argenta.response.entity import Response
|
||||
from argenta.router import Router
|
||||
from argenta.router.entity import ( # pyright: ignore[reportPrivateUsage]
|
||||
_structuring_input_flags, _validate_command, _validate_func_args)
|
||||
from argenta.router.entity import _structuring_input_flags, _validate_command, _validate_func_args # pyright: ignore[reportPrivateUsage]
|
||||
from argenta.router.exceptions import (RepeatedFlagNameException,
|
||||
RequiredArgumentNotPassedException,
|
||||
TriggerContainSpacesException)
|
||||
|
||||
Reference in New Issue
Block a user