~johnsca/charmworld/fix-reviewer-tips-link

« back to all changes in this revision

Viewing changes to charmworld/views/tests/test_proof.py

Bundle proof errors if juju-gui included.

The juju-gui should not be a part of a bundle, though the juju-gui export
mechanism has historically included it when doing the export.  Because it has
been in the exports, and most bundles start out as an export that then gets
tuned, a lot of existing bundles have juju-gui in them.

https://codereview.appspot.com/83270048/

R=hatch.

Approved by Juju Gui Bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
620
620
 
621
621
        expected = 'wiki/charm: unsupported constraints: cpu-donkeys'
622
622
        self.assertEqual([expected], results['error_messages'])
 
623
 
 
624
    def test_bundle_with_juju_gui(self):
 
625
        # If a service with the name "juju-gui" is part of the bundle then
 
626
        # proof should error.
 
627
        charm = self.setup_charm()
 
628
        bundle_config = {
 
629
            'wiki': {
 
630
                'services': {
 
631
                    'juju-gui': {
 
632
                        'charm_url': str(charm.store_url),
 
633
                    }
 
634
                }
 
635
            }
 
636
        }
 
637
        request = self.make_request('bundle', remainder='/proof')
 
638
        request.params = {
 
639
            'deployer_file': yaml.dump(bundle_config),
 
640
        }
 
641
        response = self.api_class(request)()
 
642
        self.assertEqual(200, response.status_code)
 
643
        results = response.json_body
 
644
        self.assertEqual(1, len(results['errors']))
 
645
        self.assertEqual(1, len(results['error_messages']))
 
646
        self.assertEqual(0, len(results['warning_messages']))
 
647
        expected = 'wiki/juju-gui: Bundles may not include the juju-gui charm.'
 
648
        self.assertEqual([expected], results['error_messages'])