start make tests

This commit is contained in:
2025-03-03 00:10:07 +03:00
parent 5e6cdc342e
commit d9c74310c3
33 changed files with 100 additions and 69 deletions
+1
View File
@@ -0,0 +1 @@
from .entity import Command
+3 -3
View File
@@ -19,7 +19,7 @@ class Command(Generic[T]):
flags: Flag | FlagsGroup | None = None):
self._command = command
self._description = description
self._flags: FlagsGroup | None = flags if isinstance(flags, FlagsGroup) else FlagsGroup([flags]) if isinstance(flags, Flag) else flags
self._registered_flags: FlagsGroup | None = flags if isinstance(flags, FlagsGroup) else FlagsGroup([flags]) if isinstance(flags, Flag) else flags
self._input_flags: FlagsGroup | None = None
@@ -37,7 +37,7 @@ class Command(Generic[T]):
def get_registered_flags(self):
return self._flags
return self._registered_flags
def validate_commands_params(self):
@@ -45,7 +45,7 @@ class Command(Generic[T]):
raise InvalidCommandInstanceException(self._command)
if not isinstance(self._description, str):
raise InvalidDescriptionInstanceException()
if not any([(isinstance(self._flags, FlagsGroup)), not self._flags]):
if not any([(isinstance(self._registered_flags, FlagsGroup)), not self._registered_flags]):
raise InvalidFlagsInstanceException
-5
View File
@@ -29,11 +29,6 @@ class RepeatedInputFlagsException(Exception):
f"Duplicate flag was detected in the input: '{self.flag.get_string_entity()}'")
class IncorrectNumberOfHandlerArgsException(Exception):
def __str__(self):
return "Incorrect Input Flags Handler has incorrect number of arguments"
class EmptyInputCommandException(Exception):
def __str__(self):
return "Input Command is empty"
+2
View File
@@ -0,0 +1,2 @@
from .entity import Flag
from .flags_group.entity import FlagsGroup