~bac/charmworld/tag-constraints

« back to all changes in this revision

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

  • Committer: Tarmac
  • Author(s): Matthew Scott
  • Date: 2014-03-07 16:13:24 UTC
  • mfrom: (487.3.4 charm-urls)
  • Revision ID: tarmac-20140307161324-8quz1tbpjxvq5all
Normalize charm URLs in bundles

This branch normalizes the charm URLs in bundles for the GUI, which is expecting at least a <schema>:<series>/<name> style URL.  Current proof allows bundles with charms specified only by name, so long as they're in the charmstore already.

Caveats:
* Currently only works on ingest
* May require a GUI branch as well to add -HEAD if no version number (a smart move anyway) depending on API support.


QA:
* Run
* Enqueue and ingest at least mysql and mediawiki
* bin/enqueue --prefix=~bac/charms/bundles
* bin/ingest-queued --prefix=~bac/charms/bundles --limit=100
* Get bac's bundle wiki:wiki - the charms should all have a charm: attribute, and the attributes should all be URLs as specified above.

https://codereview.appspot.com/71070051/

R=benji, rharding.

Approved by Benji York, Juju Gui Bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
        self.assertEqual(200, response.status_code)
111
111
        results = response.json_body
112
112
        self.assertEqual(0, len(results['errors']))
 
113
        self.assertEqual(1, len(results['services_info'].items()))
 
114
        self.assertEqual(charm.store_url,
 
115
                         results['services_info']['charm']['store_url'])
113
116
 
114
117
    def test_bundle_proof_invalid_config_type(self):
115
118
        charm = self.setup_charm()