Fixed cli schematics & added tests

This commit is contained in:
Sven Heidemann 2023-04-07 13:42:20 +02:00
parent 3fc713cc8d
commit 1b60debba7
8 changed files with 66 additions and 3 deletions

View File

@ -1,6 +1,7 @@
import textwrap
from cpl_cli.abc.generate_schematic_abc import GenerateSchematicABC
from cpl_core.utils import String
class ApplicationExtension(GenerateSchematicABC):
@ -22,7 +23,7 @@ class ApplicationExtension(GenerateSchematicABC):
def run(self, config: ConfigurationABC, services: ServiceProviderABC):
pass
"""
x = self.build_code_str(code, Name=self._class_name)
x = self.build_code_str(code, Name=String.convert_to_camel_case(self._class_name))
return x
@classmethod

View File

@ -1,6 +1,7 @@
import textwrap
from cpl_cli.abc.generate_schematic_abc import GenerateSchematicABC
from cpl_core.utils import String
class StartupExtension(GenerateSchematicABC):
@ -26,7 +27,7 @@ class StartupExtension(GenerateSchematicABC):
def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironmentABC):
pass
"""
x = self.build_code_str(code, Name=self._class_name)
x = self.build_code_str(code, Name=String.convert_to_camel_case(self._class_name))
return x
@classmethod

View File

@ -1,6 +1,7 @@
import textwrap
from cpl_cli.abc.generate_schematic_abc import GenerateSchematicABC
from cpl_core.utils import String
class TestCase(GenerateSchematicABC):
@ -20,7 +21,7 @@ class TestCase(GenerateSchematicABC):
def test_equal(self):
pass
"""
return self.build_code_str(code, Name=self._class_name)
return self.build_code_str(code, Name=String.convert_to_camel_case(self._class_name))
@classmethod
def register(cls):

View File

@ -0,0 +1,24 @@
import unittest
from unittests_core.utils.string_test_case import StringTestCase
from unittests_query.enumerable_query_test_case import EnumerableQueryTestCase
from unittests_query.enumerable_test_case import EnumerableTestCase
from unittests_query.iterable_query_test_case import IterableQueryTestCase
from unittests_query.iterable_test_case import IterableTestCase
from unittests_query.sequence_test_case import SequenceTestCase
class QueryTestSuite(unittest.TestSuite):
def __init__(self):
unittest.TestSuite.__init__(self)
loader = unittest.TestLoader()
self.addTests(loader.loadTestsFromTestCase(StringTestCase))
def run(self, *args):
super().run(*args)
if __name__ == "__main__":
runner = unittest.TextTestRunner()
runner.run(QueryTestSuite())

View File

@ -0,0 +1,16 @@
from cpl_core.application.startup_extension_abc import StartupExtensionABC
from cpl_core.configuration.configuration_abc import ConfigurationABC
from cpl_core.dependency_injection.service_collection_abc import ServiceCollectionABC
from cpl_core.environment.application_environment_abc import ApplicationEnvironmentABC
class TestStartup_extension(StartupExtensionABC):
def __init__(self):
pass
def configure_configuration(self, config: ConfigurationABC, env: ApplicationEnvironmentABC):
pass
def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironmentABC):
pass

View File

@ -0,0 +1,10 @@
import unittest
class CredentialManagerTestCase(unittest.TestCase):
def setUp(self):
pass
def test_equal(self):
pass

View File

@ -0,0 +1,10 @@
import unittest
class StringTestCase(unittest.TestCase):
def setUp(self):
pass
def test_equal(self):
pass