~juju-gui/juju-gui/trunk

« back to all changes in this revision

Viewing changes to test/test_sandbox_python.js

  • Committer: Jeff Pihach
  • Date: 2013-09-03 16:09:24 UTC
  • mfrom: (992.3.15 save-changed-1214087)
  • Revision ID: jeff.pihach@canonical.com-20130903160924-mjy240b4rx67dzn1
Only sends the changed config options.

1) There was a bug with the ghost constraints code which
   caused it to fail when deploying services on rapi.

2) The GUI now only sends configuration values to juju when
   those values differ from the defaults.

R=frankban, rharding
CC=
https://codereview.appspot.com/13252045

Show diffs side-by-side

added added

removed removed

Lines of Context:
341
341
        op: 'deploy',
342
342
        charm_url: 'cs:precise/wordpress-15',
343
343
        service_name: 'kumquat',
344
 
        config_raw: 'funny: business',
 
344
        config_raw: 'engine: apache',
345
345
        num_units: 2,
346
346
        request_id: 42
347
347
      };
358
358
          var service = state.db.services.getById('kumquat');
359
359
          assert.isObject(service);
360
360
          assert.equal(service.get('charm'), 'cs:precise/wordpress-15');
361
 
          assert.deepEqual(service.get('config'), {funny: 'business'});
 
361
          assert.deepEqual(service.get('config'), {
 
362
            debug: 'no',
 
363
            engine: 'apache',
 
364
            tuning: 'single',
 
365
            'wp-content': ''
 
366
          });
362
367
          var units = state.db.units.get_units_for_service(service);
363
368
          assert.lengthOf(units, 2);
364
369
          done();
376
381
          assert.equal(result.charm_url, 'cs:precise/wordpress-15');
377
382
          var service = state.db.services.getById('kumquat');
378
383
          assert.equal(service.get('charm'), 'cs:precise/wordpress-15');
379
 
          assert.deepEqual(service.get('config'), {llama: 'pajama'});
 
384
          assert.deepEqual(service.get('config'), {
 
385
            debug: 'no',
 
386
            engine: 'apache',
 
387
            tuning: 'single',
 
388
            'wp-content': ''
 
389
          });
380
390
          done();
381
391
        };
382
392
        env.deploy(
383
393
            'cs:precise/wordpress-15',
384
394
            'kumquat',
385
 
            {llama: 'pajama'},
 
395
            {engine: 'apache'},
386
396
            null,
387
397
            1,
388
398
            null,
799
809
        var op = {
800
810
          op: 'set_config',
801
811
          service_name: 'wordpress',
802
 
          config: {'blog-title': 'Inimical'},
 
812
          config: {'engine': 'apache'},
803
813
          request_id: 99
804
814
        };
805
815
        client.onmessage = function(received) {
806
816
          var parsed = Y.JSON.parse(received.data);
807
 
          assert.deepEqual(parsed.result, {'blog-title': 'Inimical'});
 
817
          assert.deepEqual(parsed.result, {
 
818
            debug: 'no',
 
819
            engine: 'apache',
 
820
            tuning: 'single',
 
821
            'wp-content': ''
 
822
          });
808
823
          var service = state.db.services.getById('wordpress');
809
 
          assert.equal(service.get('config')['blog-title'], 'Inimical');
 
824
          assert.equal(service.get('config').engine, 'apache');
810
825
          // Error should be undefined.
811
826
          done(parsed.error);
812
827
        };