PY-20752 PY-20754 PY-20798 Add tests

This commit is contained in:
Valentina Kiryushkina
2016-09-28 14:36:09 +03:00
parent 2d68b1875b
commit 46e0c6965d
9 changed files with 34 additions and 0 deletions
@@ -0,0 +1 @@
print(b'Hello %b!' <caret>% b'World')
@@ -0,0 +1 @@
print(b'Hello %b!' % b'World')
@@ -0,0 +1,2 @@
data = dict(first='Hodor', last='Hodor!')
print('%(first)s %(last)s' <caret>% data)
@@ -0,0 +1,2 @@
data = dict(first='Hodor', last='Hodor!')
print('{first} {last}'.format(**data))
@@ -0,0 +1,2 @@
data = {'first': 'Hodor', 'last': 'Hodor!'}
print('%(first)s %(last)s' <caret>% data)
@@ -0,0 +1,2 @@
data = {'first': 'Hodor', 'last': 'Hodor!'}
print('{first} {last}'.format(**data))
@@ -0,0 +1,2 @@
coord = (3, 5)
print('X: %s; Y: %s' <caret>% coord)
@@ -0,0 +1,2 @@
coord = (3, 5)
print('X: {}; Y: {}'.format(*coord))
@@ -43,4 +43,24 @@ public class PyConvertFormatOperatorToMethodIntentionTest extends PyIntentionTes
public void testConcatenated() {
doTest(PyBundle.message("INTN.replace.with.method"), LanguageLevel.PYTHON26);
}
// PY-20752
public void testTupleReference() {
doTest(PyBundle.message("INTN.replace.with.method"), LanguageLevel.PYTHON26);
}
// PY-20798
public void testDictReference() {
doTest(PyBundle.message("INTN.replace.with.method"), LanguageLevel.PYTHON26);
}
// PY-20798
public void testDictCallReference() {
doTest(PyBundle.message("INTN.replace.with.method"), LanguageLevel.PYTHON26);
}
// PY-20754
public void testBytes() {
doNegativeTest(PyBundle.message("INTN.replace.with.method"));
}
}