2 * Copyright 2000-2016 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com.jetbrains.python.intentions;
18 import com.jetbrains.python.PyBundle;
19 import com.jetbrains.python.psi.LanguageLevel;
21 public class PyConvertTypeCommentToVariableAnnotationIntentionTest extends PyIntentionTestCase {
22 private void doPositiveTest() {
23 doTest(PyBundle.message("INTN.convert.type.comment.to.variable.annotation.text"), LanguageLevel.PYTHON36);
26 private void doNegativeTest() {
27 runWithLanguageLevel(LanguageLevel.PYTHON36, () -> {
28 doNegativeTest(PyBundle.message("INTN.convert.type.comment.to.variable.annotation.text"));
32 public void testSimpleAssignment() {
36 public void testBadLanguageLevel() {
37 runWithLanguageLevel(LanguageLevel.PYTHON35, () -> {
38 doNegativeTest(PyBundle.message("INTN.convert.type.comment.to.variable.annotation.text"));
42 public void testChainedAssignment() {
46 public void testAssignmentWithUnpacking() {
50 public void testMultilineAssignment() {
54 public void testSimpleForLoop() {
58 public void testSimpleWithStatement() {
62 public void testForLoopWithUnpacking() {
66 public void testWithStatementWithUnpacking() {
70 public void testWithStatementWithMultipleWithItems() {