commit/galaxy-central: jmchilton: casperjs: Enable api.tools.create and add test.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/35b1a3c6e617/ Changeset: 35b1a3c6e617 User: jmchilton Date: 2013-12-13 17:24:09 Summary: casperjs: Enable api.tools.create and add test. Affected #: 2 files diff -r f92fe13caa5934d45397442dff658fc3c26cdf59 -r 35b1a3c6e617247de50ac3f83de46a090f9ac59c test/casperjs/api-tool-tests.js --- a/test/casperjs/api-tool-tests.js +++ b/test/casperjs/api-tool-tests.js @@ -213,6 +213,29 @@ // ------------------------------------------------------------------------------------------- CREATE // this is a method of running a job. Shouldn't that be in jobs.create? + this.test.comment( 'create should work' ); + var upload_params = { + 'files_0|NAME': 'Test Dataset', + 'files_0|url_paste': 'Hello World', + 'dbkey': '?', + 'file_type': 'txt' + }; + var payload = { + 'tool_id': 'upload1', + 'inputs': upload_params, + 'upload_type': 'upload_dataset', + }; + var toolCreate = this.api.tools.create( payload ); + this.test.assert( hasKeys( toolCreate, ['outputs'] ), 'Has outputs' ); + var outputs = toolCreate['outputs']; + this.test.assert( utils.isArray( outputs ), 'outputs is an array' ); + this.test.assert( outputs.length == 1, 'one dataset is created' ); + + var output = outputs[0] + this.test.assert( utils.isObject( output ), 'output0 is an array' ); + this.test.assert( hasKeys( output, ['data_type', 'deleted', 'hid', 'history_id', 'id', 'name' ] ), 'Dataset information defined' ); + this.test.assert( hasKeys( output, ['output_name' ] ), 'Output name labelled' ); + // ------------------------------------------------------------------------------------------- MISC //attemptShowOnAllTools.call( spaceghost ); }); diff -r f92fe13caa5934d45397442dff658fc3c26cdf59 -r 35b1a3c6e617247de50ac3f83de46a090f9ac59c test/casperjs/modules/api.js --- a/test/casperjs/modules/api.js +++ b/test/casperjs/modules/api.js @@ -338,16 +338,16 @@ }); }; -//ToolsAPI.prototype.create = function create( payload ){ -// this.api.spaceghost.info( 'tools.create: ' + [ this.api.spaceghost.jsonStr( payload ) ] ); -// -// // py.payload <-> ajax.data -// payload = this.api.ensureObject( payload ); -// return this.api._ajax( utils.format( this.urlTpls.create, this.api.ensureId( historyId ) ), { -// type : 'POST', -// data : payload -// }); -//}; +ToolsAPI.prototype.create = function create( payload ){ + this.api.spaceghost.info( 'tools.create: ' + [ this.api.spaceghost.jsonStr( payload ) ] ); + + // py.payload <-> ajax.data + payload = this.api.ensureObject( payload ); + return this.api._ajax( utils.format( this.urlTpls.create ), { + type : 'POST', + data : payload + }); +}; // =================================================================== WORKFLOWS Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org