@@ -0,0 +1,2769 @@
+// Copyright 2021 The Bazel Authors. All rights reserved.%0A//%0A// Licensed under the Apache License, Version 2.0 (the %22License%22);%0A// you may not use this file except in compliance with the License.%0A// You may obtain a copy of the License at%0A//%0A//    http://www.apache.org/licenses/LICENSE-2.0%0A//%0A// Unless required by applicable law or agreed to in writing, software%0A// distributed under the License is distributed on an %22AS IS%22 BASIS,%0A// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A// See the License for the specific language governing permissions and%0A// limitations under the License.%0Apackage com.google.devtools.build.lib.view.python;%0A%0Aimport static com.google.common.truth.Truth.assertThat;%0Aimport static com.google.devtools.build.lib.actions.util.ActionsTestUtil.prettyArtifactNames;%0A%0Aimport com.google.devtools.build.lib.analysis.ConfiguredTarget;%0Aimport com.google.devtools.build.lib.analysis.FileProvider;%0Aimport com.google.devtools.build.lib.analysis.util.BuildViewTestCase;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.junit.runners.JUnit4;%0A%0A/** Tests PythonRuntimeAlias class */%0A@RunWith(JUnit4.class)%0Apublic class PythonRuntimeAliasTest extends BuildViewTestCase %7B%0A%0A  @Test%0A  public void testPythonRuntimeAlias() throws Exception %7B%0A    scratch.file(%22a/BUILD%22, %22python_runtime_alias(name='current_python_runtime')%22);%0A%0A    ConfiguredTarget target = getConfiguredTarget(%22//a:current_python_runtime%22);%0A%0A    assertThat(target.getLabel().toString()).isEqualTo(%22//tools/python:default_python_runtime%22);%0A  %7D%0A%0A  @Test%0A  public void testPythonRuntimeAliasWithPythonTopArgument() throws Exception %7B%0A    scratch.file(%22a/BUILD%22, %22python_runtime_alias(name='current_python_runtime')%22);%0A    scratch.file(%22b/BUILD%22, %22filegroup(name = 'another_python_top', srcs = %5B%5D)%22);%0A    useConfiguration(%22--python_top=//b:another_python_top%22);%0A%0A    ConfiguredTarget target = getConfiguredTarget(%22//a:current_python_runtime%22);%0A%0A    assertThat(target.getLabel().toString()).isEqualTo(%22//b:another_python_top%22);%0A  %7D%0A%0A  @Test%0A  public void testFileProviderInPythonRuntimeAlias() throws Exception %7B%0A    scratch.file(%22a/BUILD%22, %22python_runtime_alias(name='current_python_runtime')%22);%0A    scratch.file(%0A        %22b/BUILD%22,%0A        %22filegroup(%22,%0A        %22    name = 'another_python_top',%22,%0A        %22    srcs = %5B'some.file1', 'some.file2'%5D%22,%0A        %22)%22);%0A    useConfiguration(%22--python_top=//b:another_python_top%22);%0A%0A    ConfiguredTarget target = getConfiguredTarget(%22//a:current_python_runtime%22);%0A    FileProvider fileProvider = target.getProvider(FileProvider.class);%0A%0A    assertThat(fileProvider).isNotNull();%0A    assertThat(prettyArtifactNames(fileProvider.getFilesToBuild()))%0A        .containsExactly(%22b/some.file1%22, %22b/some.file2%22);%0A  %7D%0A%7D%0A

Add PythonRuntimeAliasTest.