Search in sources :

Example 1 with PythonSdkFlavor

use of com.jetbrains.python.sdk.flavors.PythonSdkFlavor in project intellij-community by JetBrains.

the class PySdkFlavorTest method testPyPy323VersionString.

public void testPyPy323VersionString() {
    final PythonSdkFlavor flavor = PyPySdkFlavor.INSTANCE;
    final String versionOutput = "Python 3.2.5 (986752d005bb6c65ce418113e4c3cd115f61a9b4, Jun 23 2014, 00:23:34)\n" + "[PyPy 2.3.1 with GCC 4.8.2]\n";
    final Sdk mockSdk = createMockSdk(flavor, versionOutput);
    assertEquals("PyPy 2.3.1 [Python 3.2.5]", mockSdk.getVersionString());
    assertEquals(LanguageLevel.PYTHON32, flavor.getLanguageLevel(mockSdk));
    assertEquals("builtins.py", PythonSdkType.getBuiltinsFileName(mockSdk));
}
Also used : UnixPythonSdkFlavor(com.jetbrains.python.sdk.flavors.UnixPythonSdkFlavor) PythonSdkFlavor(com.jetbrains.python.sdk.flavors.PythonSdkFlavor) Sdk(com.intellij.openapi.projectRoots.Sdk)

Example 2 with PythonSdkFlavor

use of com.jetbrains.python.sdk.flavors.PythonSdkFlavor in project intellij-community by JetBrains.

the class PySdkFlavorTest method testPython27VersionString.

public void testPython27VersionString() {
    final PythonSdkFlavor flavor = UnixPythonSdkFlavor.INSTANCE;
    final String versionOutput = "Python 2.7.6\n";
    final Sdk mockSdk = createMockSdk(flavor, versionOutput);
    assertEquals("Python 2.7.6", mockSdk.getVersionString());
    assertEquals(LanguageLevel.PYTHON27, flavor.getLanguageLevel(mockSdk));
}
Also used : UnixPythonSdkFlavor(com.jetbrains.python.sdk.flavors.UnixPythonSdkFlavor) PythonSdkFlavor(com.jetbrains.python.sdk.flavors.PythonSdkFlavor) Sdk(com.intellij.openapi.projectRoots.Sdk)

Example 3 with PythonSdkFlavor

use of com.jetbrains.python.sdk.flavors.PythonSdkFlavor in project intellij-community by JetBrains.

the class PySdkFlavorTest method testPyPy23VersionString.

public void testPyPy23VersionString() {
    final PythonSdkFlavor flavor = PyPySdkFlavor.INSTANCE;
    final String versionOutput = "Python 2.7.6 (32f35069a16d819b58c1b6efb17c44e3e53397b2, Jun 10 2014, 00:42:27)\n" + "[PyPy 2.3.1 with GCC 4.8.2]\n";
    final Sdk mockSdk = createMockSdk(flavor, versionOutput);
    assertEquals("PyPy 2.3.1 [Python 2.7.6]", mockSdk.getVersionString());
    assertEquals(LanguageLevel.PYTHON27, flavor.getLanguageLevel(mockSdk));
    assertEquals("__builtin__.py", PythonSdkType.getBuiltinsFileName(mockSdk));
}
Also used : UnixPythonSdkFlavor(com.jetbrains.python.sdk.flavors.UnixPythonSdkFlavor) PythonSdkFlavor(com.jetbrains.python.sdk.flavors.PythonSdkFlavor) Sdk(com.intellij.openapi.projectRoots.Sdk)

Example 4 with PythonSdkFlavor

use of com.jetbrains.python.sdk.flavors.PythonSdkFlavor in project intellij-community by JetBrains.

the class PySdkFlavorTest method testJython25VersionString.

public void testJython25VersionString() {
    final PythonSdkFlavor flavor = JythonSdkFlavor.INSTANCE;
    final String versionOutput = "Jython 2.5.3\n";
    final Sdk mockSdk = createMockSdk(flavor, versionOutput);
    assertEquals("Jython 2.5.3", mockSdk.getVersionString());
    assertEquals(LanguageLevel.PYTHON25, flavor.getLanguageLevel(mockSdk));
}
Also used : UnixPythonSdkFlavor(com.jetbrains.python.sdk.flavors.UnixPythonSdkFlavor) PythonSdkFlavor(com.jetbrains.python.sdk.flavors.PythonSdkFlavor) Sdk(com.intellij.openapi.projectRoots.Sdk)

Example 5 with PythonSdkFlavor

use of com.jetbrains.python.sdk.flavors.PythonSdkFlavor in project intellij-community by JetBrains.

the class PySdkFlavorTest method testPython34VersionString.

public void testPython34VersionString() {
    final PythonSdkFlavor flavor = UnixPythonSdkFlavor.INSTANCE;
    final String versionOutput = "Python 3.4.0\n";
    final Sdk mockSdk = createMockSdk(flavor, versionOutput);
    assertEquals("Python 3.4.0", mockSdk.getVersionString());
    assertEquals(LanguageLevel.PYTHON34, flavor.getLanguageLevel(mockSdk));
}
Also used : UnixPythonSdkFlavor(com.jetbrains.python.sdk.flavors.UnixPythonSdkFlavor) PythonSdkFlavor(com.jetbrains.python.sdk.flavors.PythonSdkFlavor) Sdk(com.intellij.openapi.projectRoots.Sdk)

Aggregations

PythonSdkFlavor (com.jetbrains.python.sdk.flavors.PythonSdkFlavor)18 Sdk (com.intellij.openapi.projectRoots.Sdk)9 UnixPythonSdkFlavor (com.jetbrains.python.sdk.flavors.UnixPythonSdkFlavor)6 CPythonSdkFlavor (com.jetbrains.python.sdk.flavors.CPythonSdkFlavor)4 LanguageLevel (com.jetbrains.python.psi.LanguageLevel)2 Nullable (org.jetbrains.annotations.Nullable)2 RunnerAndConfigurationSettings (com.intellij.execution.RunnerAndConfigurationSettings)1 Result (com.intellij.openapi.application.Result)1 WriteAction (com.intellij.openapi.application.WriteAction)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 LayeredIcon (com.intellij.ui.LayeredIcon)1 Course (com.jetbrains.edu.learning.courseFormat.Course)1 CommandLinePatcher (com.jetbrains.python.run.CommandLinePatcher)1 PyDetectedSdk (com.jetbrains.python.sdk.PyDetectedSdk)1 IronPythonSdkFlavor (com.jetbrains.python.sdk.flavors.IronPythonSdkFlavor)1 JythonSdkFlavor (com.jetbrains.python.sdk.flavors.JythonSdkFlavor)1 VirtualEnvSdkFlavor (com.jetbrains.python.sdk.flavors.VirtualEnvSdkFlavor)1 AbstractPythonLegacyTestRunConfiguration (com.jetbrains.python.testing.AbstractPythonLegacyTestRunConfiguration)1 ArrayList (java.util.ArrayList)1 NonNls (org.jetbrains.annotations.NonNls)1