RandooPy: provide integration for other algorithm
@@ -37,7 +37,7 @@ from pynguin.testcase.execution.testcaseexecutor import TestCaseExecutor
"tests.fixtures.examples.type_inference",
],
)
-def test_integrate_examples_exceptions(module_name):
+def test_integrate_randoopy(module_name):
config.INSTANCE.budget = 1
config.INSTANCE.module_name = module_name
config.INSTANCE.measure_coverage = False
@@ -48,3 +48,32 @@ def test_integrate_examples_exceptions(module_name):
test_cases, failing_test_cases = algorithm.generate_sequences()
assert len(test_cases) >= 0
assert len(failing_test_cases) >= 0
+
+
+@pytest.mark.parametrize(
+ "module_name",
+ [
+ "tests.fixtures.accessibles.accessible",
+ "tests.fixtures.cluster.dependency",
+ "tests.fixtures.cluster.no_dependencies",
+ "tests.fixtures.cluster.simple_dependencies",
+ "tests.fixtures.examples.basket",
+ "tests.fixtures.examples.dummies",
+ "tests.fixtures.examples.exceptions",
+ "tests.fixtures.examples.monkey",
+ "tests.fixtures.examples.triangle",
+ "tests.fixtures.examples.type_inference",
+ ],
+)
+def test_integrate_randoopy_monkey_type(module_name):
+ config.INSTANCE.budget = 1
+ config.INSTANCE.module_name = module_name
+ config.INSTANCE.measure_coverage = False
+ config.INSTANCE.algorithm = config.Algorithm.RANDOOPY_MONKEYTYPE
+ logger = MagicMock(Logger)
+ executor = TestCaseExecutor()
+ algorithm = RandomTestStrategy(executor)
+ algorithm._logger = logger
+ test_cases, failing_test_cases = algorithm.generate_sequences()
+ assert len(test_cases) >= 0
+ assert len(failing_test_cases) >= 0
