mirror of
https://github.com/koloideal/Argenta.git
synced 2026-06-10 18:15:28 +03:00
new tests
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "argenta"
|
name = "argenta"
|
||||||
version = "1.0.0-alpha1"
|
version = "1.0.0-alpha2"
|
||||||
description = "Python library for creating TUI"
|
description = "Python library for creating TUI"
|
||||||
authors = [{ name = "kolo", email = "kolo.is.main@gmail.com" }]
|
authors = [{ name = "kolo", email = "kolo.is.main@gmail.com" }]
|
||||||
requires-python = ">=3.11, <4.0"
|
requires-python = ">=3.11, <4.0"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
from argenta.command.models import InputCommand, Command
|
from argenta.command.models import InputCommand, Command
|
||||||
from src.argenta.app import App
|
from argenta.app import App
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
@@ -32,9 +32,28 @@ class MyTestCase(unittest.TestCase):
|
|||||||
|
|
||||||
def test_is_unknown_command1(self):
|
def test_is_unknown_command1(self):
|
||||||
app = App()
|
app = App()
|
||||||
|
app.set_unknown_command_handler(lambda command: None)
|
||||||
app._all_registered_triggers_in_lower = ['fr', 'tr', 'de']
|
app._all_registered_triggers_in_lower = ['fr', 'tr', 'de']
|
||||||
self.assertEqual(app._is_unknown_command(InputCommand('fr')), False)
|
self.assertEqual(app._is_unknown_command(InputCommand('fr')), False)
|
||||||
|
|
||||||
|
def test_is_unknown_command2(self):
|
||||||
|
app = App()
|
||||||
|
app.set_unknown_command_handler(lambda command: None)
|
||||||
|
app._all_registered_triggers_in_lower = ['fr', 'tr', 'de']
|
||||||
|
self.assertEqual(app._is_unknown_command(InputCommand('cr')), True)
|
||||||
|
|
||||||
|
def test_is_unknown_command3(self):
|
||||||
|
app = App(ignore_command_register=False)
|
||||||
|
app.set_unknown_command_handler(lambda command: None)
|
||||||
|
app._all_registered_triggers_in_default_case = ['Pr', 'tW', 'deQW']
|
||||||
|
self.assertEqual(app._is_unknown_command(InputCommand('pr')), True)
|
||||||
|
|
||||||
|
def test_is_unknown_command4(self):
|
||||||
|
app = App(ignore_command_register=False)
|
||||||
|
app.set_unknown_command_handler(lambda command: None)
|
||||||
|
app._all_registered_triggers_in_default_case = ['Pr', 'tW', 'deQW']
|
||||||
|
self.assertEqual(app._is_unknown_command(InputCommand('tW')), False)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
from argenta.command.flag import InputFlags, InputFlag, Flag, Flags
|
from argenta.command.flag import InputFlags, InputFlag, Flag, Flags
|
||||||
from src.argenta.router import Router
|
from argenta.router import Router
|
||||||
from src.argenta.command import Command
|
from argenta.command import Command
|
||||||
from src.argenta.router.exceptions import (TriggerContainSpacesException,
|
from argenta.router.exceptions import (TriggerContainSpacesException,
|
||||||
RepeatedFlagNameException,
|
RepeatedFlagNameException,
|
||||||
TooManyTransferredArgsException,
|
TooManyTransferredArgsException,
|
||||||
RequiredArgumentNotPassedException)
|
RequiredArgumentNotPassedException)
|
||||||
|
|||||||
Reference in New Issue
Block a user