mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
add env test for series (PY-21763)
This commit is contained in:
8
python/testData/debug/test_series.py
Normal file
8
python/testData/debug/test_series.py
Normal file
@@ -0,0 +1,8 @@
|
||||
import pandas as pd
|
||||
import numpy as np
|
||||
|
||||
frame = pd.DataFrame(data=np.random.randint(0, high=10, size=(4, 2)), columns=['a', 'b'], index=pd.MultiIndex([['s', 'd'], [2, 3]], [[0, 0, 1, 1], [0, 1, 0, 1]]))
|
||||
|
||||
series = frame.a
|
||||
|
||||
print(series) # line 7
|
||||
@@ -20,6 +20,7 @@ import com.intellij.util.Consumer;
|
||||
import com.intellij.xdebugger.XDebugSession;
|
||||
import com.intellij.xdebugger.XDebuggerTestUtil;
|
||||
import com.jetbrains.env.PyEnvTestCase;
|
||||
import com.jetbrains.env.Staging;
|
||||
import com.jetbrains.env.python.debug.PyDebuggerTask;
|
||||
import com.jetbrains.python.debugger.ArrayChunk;
|
||||
import com.jetbrains.python.debugger.PyDebugValue;
|
||||
@@ -75,6 +76,20 @@ public class PythonDataViewerTest extends PyEnvTestCase {
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
@Staging
|
||||
public void testSeries() throws Exception {
|
||||
runPythonTest(new PyDataFrameDebuggerTask(getRelativeTestDataPath(), "test_series.py", ImmutableSet.of(7)) {
|
||||
@Override
|
||||
public void testing() throws Exception {
|
||||
doTest("series", 4, 1, arrayChunk -> {
|
||||
List<String> labels = arrayChunk.getRowLabels();
|
||||
assertSameElements(labels, "s/2", "s/3", "d/2", "d/3");
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static class PyDataFrameDebuggerTask extends PyDebuggerTask {
|
||||
|
||||
private Set<Integer> myLines;
|
||||
|
||||
Reference in New Issue
Block a user