File tree Expand file tree Collapse file tree 5 files changed +18
-8
lines changed
utbot-cli-python/src/main/kotlin/org/utbot/cli/language/python
utbot-python-executor/src/main
utbot-python/src/main/kotlin/org/utbot/python Expand file tree Collapse file tree 5 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import mu.KotlinLogging
1010import org.apache.logging.log4j.LogManager
1111import org.apache.logging.log4j.core.config.Configurator
1212import org.slf4j.event.Level
13+ import org.utbot.cli.language.python.sbft.SbftGenerateTestsCommand
1314import java.util.*
1415import kotlin.system.exitProcess
1516
@@ -29,10 +30,13 @@ class UtBotPythonCli : CliktCommand(name = "UnitTestBot Python Command Line Inte
2930
3031fun main (args : Array <String >) = try {
3132 UtBotPythonCli ().subcommands(
32- PythonGenerateTestsCommand (),
33- PythonRunTestsCommand (),
34- PythonTypeInferenceCommand ()
33+ SbftGenerateTestsCommand ()
3534 ).main(args)
35+ // UtBotPythonCli().subcommands(
36+ // PythonGenerateTestsCommand(),
37+ // PythonRunTestsCommand(),
38+ // PythonTypeInferenceCommand()
39+ // ).main(args)
3640} catch (ex: Throwable ) {
3741 ex.printStackTrace()
3842 exitProcess(1 )
Original file line number Diff line number Diff line change 11[tool .poetry ]
22name = " utbot-executor"
3- version = " 1.9.0.dev10 "
3+ version = " 1.9.0"
44description = " "
55authors = [" Vyacheslav Tamarin <vyacheslav.tamarin@yandex.ru>" ]
66readme = " README.md"
Original file line number Diff line number Diff line change 1- 1.9.0.dev10
1+ 1.9.0
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ class PythonTestGenerationConfig(
2323 val timeout : Long ,
2424 val timeoutForRun : Long ,
2525 val testFramework : TestFramework ,
26- val testSourceRootPath : Path ,
26+ val testSourceRootPath : Path ? ,
2727 val withMinimization : Boolean ,
2828 val isCanceled : () -> Boolean ,
2929 val runtimeExceptionTestsBehaviour : RuntimeExceptionTestsBehaviour ,
Original file line number Diff line number Diff line change @@ -98,7 +98,13 @@ abstract class PythonTestGenerationProcessor {
9898 return notEmptyTests
9999 }
100100
101- fun testCodeGenerate (testSets : List <PythonTestSet >): String {
101+ fun testCodeGenerateSplitImports (testSets : List <PythonTestSet >): Pair <String , Set <PythonImport >> {
102+ val allImports = collectImports(testSets)
103+ val code = testCodeGenerate(testSets, true )
104+ return code to allImports
105+ }
106+
107+ fun testCodeGenerate (testSets : List <PythonTestSet >, skipImports : Boolean = false): String {
102108 val containingClassName = getContainingClassName(testSets)
103109 val classId = PythonClassId (configuration.testFileInformation.moduleName, containingClassName)
104110
@@ -123,7 +129,7 @@ abstract class PythonTestGenerationProcessor {
123129 methodIds[testSet.method] as ExecutableId to params
124130 }.toMutableMap()
125131
126- val allImports = collectImports(testSets)
132+ val allImports = if (skipImports) emptySet() else collectImports(testSets)
127133
128134 val context = UtContext (this ::class .java.classLoader)
129135 withUtContext(context) {
You can’t perform that action at this time.
0 commit comments