public void unInstallJython() { JythonInstall.uninstallJython(); Assert.That(false == Directory.Exists(JythonConfig._jythonRuntimeDir), "Jython Runtime directory should had been empty: {0}", JythonConfig._jythonRuntimeDir); }
public void installJython() { if (Directory.Exists(JythonConfig._jythonRuntimeDir)) unInstallJython(); JythonInstall.installJython(); Assert.That(Directory.Exists(JythonConfig._jythonRuntimeDir), "Could not find Jython Runtime directory: {0}", JythonConfig._jythonRuntimeDir); }
public void testJythonScriptExecution() { Assert.That(JythonInstall.checkJythonInstallation(), "checkJythonInstallation return false"); Assert.That(JythonShell.testJython("print 2+3", "5"), "testJython failed"); Assert.That(false == JythonShell.testJython("print 2+3", "4"), "testJython should had failed"); var scriptToExecute = "print 2+3"; var expectedDataReceived = "5" + Environment.NewLine; var tempPyScript = DI.config.getTempFileInTempDirectory("py"); Files.WriteFileContent(tempPyScript, scriptToExecute); var dataReceived = new JythonShell().executePythonFile(tempPyScript, ""); Assert.That(dataReceived == expectedDataReceived, "data received did no match expectedDataReceived"); File.Delete(tempPyScript); }