From e155b4ba28bdcfe757c8aaab2673e84b49073132 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Mon, 26 Jan 2015 15:41:18 +0100 Subject: Find out pengine ID server-side in run_tests --- monkey/prolog/engine.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'monkey') diff --git a/monkey/prolog/engine.py b/monkey/prolog/engine.py index e73ea54..f11854a 100644 --- a/monkey/prolog/engine.py +++ b/monkey/prolog/engine.py @@ -115,7 +115,7 @@ class PrologEngine(object): # and returns a list of results. Raises an exception on error. def test_all(name, code): engine = PrologEngine(code=code) - reply = engine.ask("run_tests({}, '{}', Results)".format(name, engine.id)) + reply = engine.ask("run_tests({}, Results)".format(name)) engine.destroy() if reply['event'] != 'success': @@ -132,7 +132,7 @@ def test(name, code): ret = False try: engine = PrologEngine(code=code) - ret = engine.ask("run_tests({}, '{}')".format(name, engine.id))['event'] == 'success' + ret = engine.ask("run_tests({})".format(name))['event'] == 'success' engine.destroy() except Exception as ex: pass @@ -142,5 +142,5 @@ def test(name, code): if __name__ == '__main__': engine = PrologEngine(code='dup([],[]). dup([H|T],[H,H|TT]) :- dup(T,TT).') print('engine id is ' + engine.id) - print(engine.ask("run_tests({},'{}',Result)".format('dup/2', engine.id))) + print(engine.ask("run_tests({}, Result)".format('dup/2'))) engine.destroy() -- cgit v1.2.1