Update test for NumpyRateResolver.

Test verifies that NumpyRateResolver doesn't increase rate for right operator found in stub in case of NDARRAY type not found.
This commit is contained in:
Semyon Proshev
2017-02-06 15:44:55 +03:00
parent 69b3a8c6cb
commit 4c4a058d8c
2 changed files with 14 additions and 10 deletions
@@ -0,0 +1,5 @@
class D1(object):
def __div__(self, other) -> "D1": ...
class D2(object):
def __rtruediv__(self, other) -> "D2": ...
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2016 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -481,15 +481,14 @@ public class Py3TypeTest extends PyTestCase {
"expr = sum([1, 2, 3])");
}
public void testDecimalDividedByInt() {
doTest("Union[Decimal, int]",
"class Decimal(object):\n" +
" def __div__(self, other):\n" +
" \"\"\"\n" +
" :rtype: Decimal" +
" \"\"\"\n" +
" pass\n" +
"expr = Decimal() / 5");
public void testNumpyResolveRaterDoesNotIncreaseRateForNotNdarrayRightOperatorFoundInStub() {
myFixture.copyDirectoryToProject(TEST_DIRECTORY + getTestName(false), "");
doTest("Union[D2, D1]",
"class D1(object):\n" +
" pass\n" +
"class D2(object):\n" +
" pass\n" +
"expr = D1() / D2()");
}
private void doTest(final String expectedType, final String text) {