From 7e18b2430e69c800adbed244378a083f34cba542 Mon Sep 17 00:00:00 2001 From: "Ilya.Kazakevich" Date: Sat, 21 Jan 2017 14:20:35 +0300 Subject: [PATCH] New test runners: folder renamed to path according to protocol --- .../testing/universalTests/PyUniversalTestForm.java | 2 +- .../python/testing/universalTests/PyUniversalTests.kt | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/python/src/com/jetbrains/python/testing/universalTests/PyUniversalTestForm.java b/python/src/com/jetbrains/python/testing/universalTests/PyUniversalTestForm.java index a4a6aee2952a..8f7ad6904d6b 100644 --- a/python/src/com/jetbrains/python/testing/universalTests/PyUniversalTestForm.java +++ b/python/src/com/jetbrains/python/testing/universalTests/PyUniversalTestForm.java @@ -186,7 +186,7 @@ public final class PyUniversalTestForm implements SimplePropertiesProvider { private void configureElementsVisibility() { final TestTargetType targetType = getTargetType(); myTargetText.setVisible(targetType != TestTargetType.CUSTOM); - myTargetText.getButton().setVisible(targetType == TestTargetType.FOLDER); + myTargetText.getButton().setVisible(targetType == TestTargetType.PATH); } @SuppressWarnings("WeakerAccess") // Accessor for property diff --git a/python/src/com/jetbrains/python/testing/universalTests/PyUniversalTests.kt b/python/src/com/jetbrains/python/testing/universalTests/PyUniversalTests.kt index 8dbc2e6a4797..467e5f6e9bed 100644 --- a/python/src/com/jetbrains/python/testing/universalTests/PyUniversalTests.kt +++ b/python/src/com/jetbrains/python/testing/universalTests/PyUniversalTests.kt @@ -135,7 +135,7 @@ abstract class PyUniversalTestSettingsEditor(private val form: PyUniversalTestFo } enum class TestTargetType(val optionName: String) { - PYTHON("--target"), FOLDER("--path"), CUSTOM("") + PYTHON("--target"), PATH("--path"), CUSTOM("") } @@ -161,7 +161,7 @@ abstract class PyUniversalTestConfiguration(project: Project, private val runBareFunctions: Boolean = true) : AbstractPythonTestRunConfiguration(project, configurationFactory), PyRerunAwareConfiguration { @DelegationProperty - val target = ConfigurationTarget(".", TestTargetType.FOLDER) + val target = ConfigurationTarget(".", TestTargetType.PATH) @ConfigField var additionalArguments = "" @@ -216,7 +216,7 @@ abstract class PyUniversalTestConfiguration(project: Project, fun reset() { target.target = "." - target.targetType = TestTargetType.FOLDER + target.targetType = TestTargetType.PATH additionalArguments = "" } @@ -260,7 +260,7 @@ abstract class PyUniversalTestConfiguration(project: Project, * Function is used to create tests by context. * * If yes, and element is [PsiElement] then it is [TestTargetType.PYTHON]. - * If file then [TestTargetType.FOLDER] + * If file then [TestTargetType.PATH] */ fun couldBeTestTarget(element: PsiElement) = // TODO: PythonUnitTestUtil logic is weak. We should give user ability to launch test on symbol since user knows better if folder @@ -341,7 +341,7 @@ object PyUniversalTestsConfigurationProducer : RunConfigurationProducer return Pair(element.virtualFile.name, ConfigurationTarget(element.virtualFile.path, TestTargetType.FOLDER)) + is PsiFile -> return Pair(element.virtualFile.name, ConfigurationTarget(element.virtualFile.path, TestTargetType.PATH)) } } element = element.parent