Merge lp:~teknico/juju-gui/get-service-tests-in-py-env into lp:juju-gui/experimental
Proposed by
Nicola Larosa
Status: | Merged |
---|---|
Merged at revision: | 492 |
Proposed branch: | lp:~teknico/juju-gui/get-service-tests-in-py-env |
Merge into: | lp:juju-gui/experimental |
Diff against target: |
84 lines (+51/-1) 3 files modified
app/store/env/go.js (+1/-1) app/store/env/python.js (+13/-0) test/test_env_python.js (+37/-0) |
To merge this branch: | bzr merge lp:~teknico/juju-gui/get-service-tests-in-py-env |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju GUI Hackers | Pending | ||
Review via email: mp+156805@code.launchpad.net |
Description of the change
Add tests to the Py env get_service.
Add tests and a doc comment to get_service in the Python environment.
To post a comment you must log in.
Reviewers: mp+156805_ code.launchpad. net,
Message:
Please take a look.
Description:
Add tests to the Py env get_service.
Add tests and a doc comment to get_service in the Python environment.
https:/ /code.launchpad .net/~teknico/ juju-gui/ get-service- tests-in- py-env/ +merge/ 156805
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/8307043/
Affected files: env/python. js env_python. js
A [revision details]
M app/store/env/go.js
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_ env_python. js env_python. js' env_python. js 2013-04-02 23:30:12 +0000 env_python. js 2013-04-03 11:12:24 +0000
request_ id: msg.request_id});
=== modified file 'test/test_
--- test/test_
+++ test/test_
@@ -121,6 +121,43 @@
});
+ it('successfully gets service configuration', function() { service( 'mysql' , function(data) { message( ); equal(service_ name, 'mysql'); deepEqual( expected, result); service( 'yoursql' , function(data) { message( ); equal(service_ name, 'yoursql'); 'successfully adds a relation', function(done) {
+ var result, service_name;
+ var expected = {
+ 'config': {'cfg_key': 'cfg_val'},
+ 'constraints': {'cstr_key': 'cstr_val'}
+ };
+ env.get_
+ service_name = data.service_name;
+ result = data.result;
+ });
+ msg = conn.last_
+ conn.msg({
+ request_id: msg.request_id,
+ service_name: 'mysql',
+ result: expected
+ });
+ assert.
+ assert.
+ });
+
+ it('handles failed get service', function() {
+ var service_name;
+ var err;
+ env.get_
+ service_name = data.service_name;
+ err = data.err;
+ });
+ msg = conn.last_
+ conn.msg({
+ request_id: msg.request_id,
+ service_name: 'yoursql',
+ err: 'service "yoursql" not found'
+ });
+ assert.
+ assert.equal(err, 'service "yoursql" not found');
+ });
+
it(
var endpoints, result;
endpointA = ['mysql', {name: 'database'}];
Index: app/store/env/go.js env/go. js'
=== modified file 'app/store/
--- app/store/env/go.js 2013-04-02 23:30:12 +0000
+++ app/store/env/go.js 2013-04-03 11:12:24 +0000
@@ -640,7 +640,7 @@
* operation is performed. It will receive an object containing:
* err - a string describing the problem (if an error occurred),
* service_name - the name of the service,
- * results: an object containing all of the configuration data for
+ * result: an object containing all of the configuration data for
* the service.
* @return {undefined} Sends a message to the server only.
*/
Index: app/store/ env/python. js env/python. js' env/python. js 2013-04-02 23:30:12 +0000 env/python. js 2013-04-03 11:12:24 +0000
=== modified file 'app/store/
--- app/store/
+++ app/store/
@@ -203,...