diff --git a/boilerplate/package.json b/boilerplate/package.json index 5adc3208..f7bc51a5 100644 --- a/boilerplate/package.json +++ b/boilerplate/package.json @@ -21,6 +21,7 @@ "grunt-cli": "^0.1.13", "matchdep": "^0.3.0", "python": "^0.0.4", - "methodmissing": "^0.0.3" + "methodmissing": "^0.0.3", + "sync-me": "^0.1.1" } } diff --git a/boilerplate/spec/test.js b/boilerplate/spec/test.js index df424f55..3d522be6 100644 --- a/boilerplate/spec/test.js +++ b/boilerplate/spec/test.js @@ -2,9 +2,11 @@ var python = require('python').shell; var web3 = require('web3'); var fs = require('fs'); var mm = require('methodmissing'); +var sync = require('sync-me'); py_exec = function(cmd) { - python(cmd, function() {}); + console.log("python: " + cmd); + return sync(python, cmd)[1]; } py_exec("from ethertdd import EvmContract") @@ -39,10 +41,9 @@ TestContractWrapper = (function() { arg_list.push(value); } - console.log(this.className + "_contract." + method + "(" + arg_list.join(",") + ")") - python(this.className + "_contract." + method + "(" + arg_list.join(",") + ")", function(err, data) { - console.log("res: " + data); - }) + data = py_exec(this.className + "_contract." + method + "(" + arg_list.join(",") + ")"); + console.log("res: " + data); + return data; }; return TestContractWrapper; @@ -52,7 +53,7 @@ TestContractWrapper = (function() { TestContract = function(contract, className) { var wrapper = new TestContractWrapper(contract, className); var Obj = mm(wrapper, function (key, args) { - wrapper.execCmd(key, args) + return wrapper.execCmd(key, args); }); return Obj; }