mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
added test code
This commit is contained in:
parent
5da3d6ede8
commit
987e2118d3
1 changed files with 14 additions and 0 deletions
|
|
@ -123,6 +123,20 @@ public class PySparkInterpreterTest {
|
|||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRedefinitionZeppelinContext() {
|
||||
if (getSparkVersionNumber() > 11) {
|
||||
String redefinitionCode = "z = 1\n";
|
||||
String restoreCode = "z = _zc\n";
|
||||
String validCode = "print(z)\n";
|
||||
|
||||
assertEquals(InterpreterResult.Code.SUCCESS, pySparkInterpreter.interpret(validCode, context).code());
|
||||
assertEquals(InterpreterResult.Code.ERROR, pySparkInterpreter.interpret(redefinitionCode, context).code());
|
||||
assertEquals(InterpreterResult.Code.SUCCESS, pySparkInterpreter.interpret(restoreCode, context).code());
|
||||
assertEquals(InterpreterResult.Code.SUCCESS, pySparkInterpreter.interpret(validCode, context).code());
|
||||
}
|
||||
}
|
||||
|
||||
private class infinityPythonJob implements Runnable {
|
||||
@Override
|
||||
public void run() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue