Add test that creates python SDK

GitOrigin-RevId: c2638e97ce4d9177c2209dd3bd468093ba48b0c2
This commit is contained in:
Ilya.Kazakevich
2024-07-12 00:48:03 +02:00
committed by intellij-monorepo-bot
parent 4e9344ce5d
commit c3f31ae2df

View File

@@ -0,0 +1,21 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.jetbrains.python.sdk
import com.intellij.openapi.projectRoots.impl.SdkConfigurationUtil
import com.intellij.testFramework.utils.vfs.refreshAndGetVirtualFile
import com.jetbrains.python.junit5.env.PyEnvTestCase
import com.jetbrains.python.junit5.env.PythonBinaryPath
import org.junit.jupiter.api.Assertions.assertNotNull
import org.junit.jupiter.api.Test
import java.nio.file.Path
@PyEnvTestCase
class SdkConfigurationUtilTestCase {
@Test
fun setupSdk(@PythonBinaryPath sdkPath: Path) {
val sdk = SdkConfigurationUtil.setupSdk(emptyArray(), sdkPath.refreshAndGetVirtualFile(), PythonSdkType.getInstance(), null, null)
assertNotNull(sdk.versionString, "$sdk must have version")
assertNotNull(sdk.name, "$sdk must have name")
}
}