2022.6.17 - Unittests #84

Merged
edraft merged 51 commits from 2022.6.17 into 2022.6 2022-06-27 10:03:55 +02:00
7 changed files with 22 additions and 28 deletions
Showing only changes of commit 8f8a9f7dd7 - Show all commits

View File

@ -1,25 +0,0 @@
import unittest
from cpl_query.tests.iterable_test import IterableTest
from cpl_query.tests.query_test import QueryTest
class Tester:
def __init__(self):
self._suite = unittest.TestSuite()
def create(self):
loader = unittest.TestLoader()
self._suite.addTests(loader.loadTestsFromTestCase(QueryTest))
self._suite.addTests(loader.loadTestsFromTestCase(IterableTest))
def start(self):
runner = unittest.TextTestRunner()
runner.run(self._suite)
if __name__ == '__main__':
tester = Tester()
tester.create()
tester.start()

View File

@ -4,6 +4,7 @@ from cpl_core.application import ApplicationABC
from cpl_core.configuration import ConfigurationABC
from cpl_core.dependency_injection import ServiceProviderABC
from unittests_cli.cli_test_suite import CLITestSuite
from unittests_query.query_test_suite import QueryTestSuite
class Application(ApplicationABC):
@ -17,3 +18,4 @@ class Application(ApplicationABC):
def main(self):
runner = unittest.TextTestRunner()
runner.run(CLITestSuite())
runner.run(QueryTestSuite())

View File

@ -3,7 +3,7 @@ import unittest
from cpl_query.extension.list import List
class IterableTest(unittest.TestCase):
class IterableTestCase(unittest.TestCase):
def setUp(self) -> None:
self._list = List(int)

View File

@ -5,10 +5,10 @@ from random import randint
from cpl_core.utils import String
from cpl_query.exceptions import InvalidTypeException, ArgumentNoneException
from cpl_query.extension.list import List
from cpl_query.tests.models import User, Address
from unittests_query.models import User, Address
class QueryTest(unittest.TestCase):
class QueryTestCase(unittest.TestCase):
def setUp(self) -> None:
self._tests = List(User)

View File

@ -0,0 +1,17 @@
import unittest
from unittests_query.iterable_test_case import IterableTestCase
from unittests_query.query_test_case import QueryTestCase
class QueryTestSuite(unittest.TestSuite):
def __init__(self):
unittest.TestSuite.__init__(self)
loader = unittest.TestLoader()
self.addTests(loader.loadTestsFromTestCase(QueryTestCase))
self.addTests(loader.loadTestsFromTestCase(IterableTestCase))
def run(self, *args):
super().run(*args)