Description:
Fix sandbox setconfig and associated test
The sandbox setconfig test was taking over a second--a pretty clear
indication that it was waiting on the fake delta stream rather than a
direct response. Investigation revealed that the sandbox method was
incorrectly using the ASYNCOP helper rather than the OP helper. This
small branch fixes the setconfig problem and adjusts the tests. The
test is very fast now (not yellow or red in the mocha output).
Reviewers: mp+158380_ code.launchpad. net,
Message:
Please take a look.
Description:
Fix sandbox setconfig and associated test
The sandbox setconfig test was taking over a second--a pretty clear
indication that it was waiting on the fake delta stream rather than a
direct response. Investigation revealed that the sandbox method was
incorrectly using the ASYNCOP helper rather than the OP helper. This
small branch fixes the setconfig problem and adjusts the tests. The
test is very fast now (not yellow or red in the mocha output).
https:/ /code.launchpad .net/~gary/ juju-gui/ setconfigfix/ +merge/ 158380
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/8663043/
Affected files: env/sandbox. js sandbox. js
A [revision details]
M app/store/
M test/test_
Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: <email address hidden>
+New revision: <email address hidden>
Index: test/test_ sandbox. js sandbox. js' sandbox. js 2013-04-10 16:38:13 +0000 sandbox. js 2013-04-11 13:56:45 +0000
request_ id: 99
client. onmessage = function(received) { parse(received. data); deepEqual( parsed. result, {'blog-title': 'Inimical'}); services. getById( 'wordpress' );
assert. equal(service. get('config' )['blog- title'] , 'Inimical'); error);
client. send(Y. JSON.stringify( op));
=== modified file 'test/test_
--- test/test_
+++ test/test_
@@ -808,10 +808,12 @@
};
+ var parsed = Y.JSON.
+ assert.
var service = state.db.
// Error should be undefined.
- done(received.
+ done(parsed.error);
};
});
Index: app/store/ env/sandbox. js env/sandbox. js' env/sandbox. js 2013-04-10 16:38:13 +0000 env/sandbox. js 2013-04-11 13:52:22 +0000
of key/value pairs. _set_config: function(data) {
=== modified file 'app/store/
--- app/store/
+++ app/store/
@@ -529,7 +529,7 @@
*/
performOp
- ASYNC_OP(this, 'setConfig', ['service_name', 'config'])(data);
+ OP(this, 'setConfig', ['service_name', 'config'], data);
},
/**