diff --git a/src/argenta/__init__.py b/src/argenta/__init__.py index 94239fd..8f4f423 100644 --- a/src/argenta/__init__.py +++ b/src/argenta/__init__.py @@ -1,3 +1,5 @@ -from argenta.app.models import App as App -from argenta.orchestrator.entity import Orchestrator as Orchestrator -from argenta.router.entity import Router as Router +__all__ = ["App", "Orchestrator", "Router"] + + +from argenta.orchestrator.entity import Orchestrator, App +from argenta.router.entity import Router diff --git a/src/argenta/orchestrator/__init__.py b/src/argenta/orchestrator/__init__.py index 62e8e21..b980d66 100644 --- a/src/argenta/orchestrator/__init__.py +++ b/src/argenta/orchestrator/__init__.py @@ -1,5 +1,4 @@ -__all__ = [ - "ArgParser", -] +__all__ = ["ArgParser", "Orchestrator"] from argenta.orchestrator.argparser.entity import ArgParser +from argenta.orchestrator.entity import Orchestrator diff --git a/src/argenta/orchestrator/entity.py b/src/argenta/orchestrator/entity.py index 3719bc1..3e7143e 100644 --- a/src/argenta/orchestrator/entity.py +++ b/src/argenta/orchestrator/entity.py @@ -1,4 +1,4 @@ -from argenta.app import App +from argenta.app.models import App from argenta.orchestrator.argparser import ArgParser from argenta.orchestrator.argparser.entity import ArgSpace diff --git a/tests/system_tests/test_system_handling_non_standard_behavior.py b/tests/system_tests/test_system_handling_non_standard_behavior.py index 7bab541..f711575 100644 --- a/tests/system_tests/test_system_handling_non_standard_behavior.py +++ b/tests/system_tests/test_system_handling_non_standard_behavior.py @@ -3,6 +3,7 @@ from unittest.mock import patch, MagicMock from unittest import TestCase import io import re +import sys from argenta.command import Command, PredefinedFlags from argenta.command.flag.models import ValidationStatus @@ -11,8 +12,15 @@ from argenta import Orchestrator, App, Router from argenta.response import Response +class PatchedArgvTestCase(TestCase): + def setUp(self): + super().setUp() + self.patcher = patch.object(sys, 'argv', ['program.py']) + self.mock_argv = self.patcher.start() + self.addCleanup(self.patcher.stop) -class TestSystemHandlerNormalWork(TestCase): + +class TestSystemHandlerNormalWork(PatchedArgvTestCase): @patch("builtins.input", side_effect=["help", "q"]) @patch("sys.stdout", new_callable=io.StringIO) def test_input_incorrect_command(self, mock_stdout: _io.StringIO, magick_mock: MagicMock): diff --git a/tests/system_tests/test_system_handling_normal_behavior.py b/tests/system_tests/test_system_handling_normal_behavior.py index c99659c..f2f5a7b 100644 --- a/tests/system_tests/test_system_handling_normal_behavior.py +++ b/tests/system_tests/test_system_handling_normal_behavior.py @@ -3,6 +3,7 @@ from unittest.mock import patch, MagicMock from unittest import TestCase import io import re +import sys from argenta.command import Command, PredefinedFlags from argenta.command.flag.models import PossibleValues, ValidationStatus @@ -12,8 +13,15 @@ from argenta.command.flag import Flag from argenta.command.flag.flags import Flags +class PatchedArgvTestCase(TestCase): + def setUp(self): + super().setUp() + self.patcher = patch.object(sys, 'argv', ['program.py']) + self.mock_argv = self.patcher.start() + self.addCleanup(self.patcher.stop) -class TestSystemHandlerNormalWork(TestCase): + +class TestSystemHandlerNormalWork(PatchedArgvTestCase): @patch("builtins.input", side_effect=["test", "q"]) @patch("sys.stdout", new_callable=io.StringIO) def test_input_correct_command(self, mock_stdout: _io.StringIO, magick_mock: MagicMock):