mirror of
https://github.com/koloideal/Argenta.git
synced 2026-06-10 10:05:28 +03:00
feat: impl docs (#4)
The entire public api is covered with documentation in two languages - Russian and English. the library now supports the latest three versions of python - 3.12, 3.13 and 3.14 minor design changes: now, when a Boolean flag is entered, its value is an empty string, not None. tests have been adapted to the supported versions of python, readmi has been redesigned in two languages, German is no longer available.
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
from argenta.command.flag import InputFlag, ValidationStatus
|
||||
from argenta.command.flag.flags.models import InputFlags
|
||||
|
||||
# Create first collection
|
||||
flags1 = InputFlags(
|
||||
[
|
||||
InputFlag(name="flag1", input_value="value1", status=ValidationStatus.VALID),
|
||||
InputFlag(name="flag2", input_value="value2", status=ValidationStatus.VALID),
|
||||
]
|
||||
)
|
||||
|
||||
# Create second collection with same flags
|
||||
flags2 = InputFlags(
|
||||
[
|
||||
InputFlag(name="flag1", input_value="value1", status=ValidationStatus.VALID),
|
||||
InputFlag(name="flag2", input_value="value2", status=ValidationStatus.VALID),
|
||||
]
|
||||
)
|
||||
|
||||
# Create third collection with different values
|
||||
flags3 = InputFlags(
|
||||
[
|
||||
InputFlag(name="flag1", input_value="different", status=ValidationStatus.VALID),
|
||||
InputFlag(name="flag2", input_value="value2", status=ValidationStatus.VALID),
|
||||
]
|
||||
)
|
||||
|
||||
print(f"flags1 == flags2: {flags1 == flags2}") # True (same names)
|
||||
print(
|
||||
f"flags1 == flags3: {flags1 == flags3}"
|
||||
) # True (same names, values are not considered)
|
||||
|
||||
# Different collections
|
||||
flags4 = InputFlags(
|
||||
[InputFlag(name="flag3", input_value="value3", status=ValidationStatus.VALID)]
|
||||
)
|
||||
print(f"flags1 == flags4: {flags1 == flags4}") # False (different flags)
|
||||
Reference in New Issue
Block a user