Skip to content

Commit

Permalink
fix testcase failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
astroshim committed Mar 8, 2017
1 parent af097ac commit f17bff4
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public void beforeTest() throws IOException {
new LocalResourcePool("id"),
new LinkedList<InterpreterContextRunner>(),
out);
pythonInterpreter.open();
}

@After
Expand All @@ -87,14 +88,12 @@ public void afterTest() throws IOException {

@Test
public void testInterpret() throws InterruptedException, IOException {
pythonInterpreter.open();
InterpreterResult result = pythonInterpreter.interpret("print \"hi\"", context);
assertEquals(InterpreterResult.Code.SUCCESS, result.code());
}

@Test
public void testInterpretInvalidSyntax() throws IOException {
pythonInterpreter.open();
InterpreterResult result = pythonInterpreter.interpret("for x in range(0,3): print (\"hi\")\n", context);
assertEquals(InterpreterResult.Code.SUCCESS, result.code());
assertTrue(new String(out.getOutputAt(0).toByteArray()).contains("hi\nhi\nhi"));
Expand Down

0 comments on commit f17bff4

Please sign in to comment.