~rharding/juju-gui/charm-details-1172050

« back to all changes in this revision

Viewing changes to test/test_env_python.js

  • Committer: Brad Crittenden
  • Date: 2013-04-19 17:43:27 UTC
  • mfrom: (563.4.4 update-config)
  • Revision ID: bac@canonical.com-20130419174327-rs79f3tqaoi0k7cw
Fix config update.

The call to set_config was not passing the proper parameters resulting in
the callback not happening.  A test has been added to ensure the two
optional parameters are passed properly to ensure this doesn't
happen again.

R=jeff.pihach, teknico
CC=
https://codereview.appspot.com/8702045

Show diffs side-by-side

added added

removed removed

Lines of Context:
158
158
      assert.equal(err, 'service "yoursql" not found');
159
159
    });
160
160
 
 
161
    it('must error if neither data nor config are passed', function() {
 
162
      assert.throws(
 
163
          function() {env.set_config('mysql', undefined, undefined);},
 
164
          'Exactly one of config and data must be provided');
 
165
    });
 
166
 
 
167
    it('must error if both data and config are passed', function() {
 
168
      assert.throws(
 
169
          function() {
 
170
            env.set_config('mysql', {'cfg-key': 'cfg-val'}, 'YAMLBEBAML');},
 
171
          'Exactly one of config and data must be provided');
 
172
    });
 
173
 
161
174
    it('can set a service config', function() {
162
175
      var config = {'cfg-key': 'cfg-val'};
163
176
      env.set_config('mysql', config);