Merge lp:~rharding/charmworld/move-bundle-url into lp:charmworld

Proposed by Richard Harding
Status: Merged
Approved by: Richard Harding
Approved revision: 445
Merged at revision: 442
Proposed branch: lp:~rharding/charmworld/move-bundle-url
Merge into: lp:charmworld
Diff against target: 255 lines (+44/-25)
5 files modified
charmworld/routes.py (+4/-4)
charmworld/views/api/__init__.py (+14/-5)
charmworld/views/tests/test_api.py (+14/-10)
charmworld/views/tests/test_bundles.py (+6/-6)
charmworld/views/tests/test_misc.py (+6/-0)
To merge this branch: bzr merge lp:~rharding/charmworld/move-bundle-url
Reviewer Review Type Date Requested Status
Juju Gui Bot continuous-integration Approve
Charmworld Developers Pending
Review via email: mp+193851@code.launchpad.net

Commit message

Update bundle user url to be /bundle/$id-bits.

- Update the api to provide that url as part of the bundle metadata so the gui
can link to it as a valid quickstart end point.
- Drive by to skip the test that fails with the known bug issue.
- Rename the TestApi2 and 3 back to not have the Z since we're just skipping
vs working around the issue.

https://codereview.appspot.com/21370044/

R=benji

Description of the change

Update bundle user url to be /bundle/$id-bits.

- Update the api to provide that url as part of the bundle metadata so the gui
can link to it as a valid quickstart end point.
- Drive by to skip the test that fails with the known bug issue.
- Rename the TestApi2 and 3 back to not have the Z since we're just skipping
vs working around the issue.

https://codereview.appspot.com/21370044/

To post a comment you must log in.
Revision history for this message
Richard Harding (rharding) wrote :
Download full text (11.4 KiB)

Reviewers: mp+193851_code.launchpad.net,

Message:
Please take a look.

Description:
Update bundle user url to be /bundle/$id-bits.

- Update the api to provide that url as part of the bundle metadata so
the gui
can link to it as a valid quickstart end point.
- Drive by to skip the test that fails with the known bug issue.
- Rename the TestApi2 and 3 back to not have the Z since we're just
skipping
vs working around the issue.

https://code.launchpad.net/~rharding/charmworld/move-bundle-url/+merge/193851

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/21370044/

Affected files (+43, -21 lines):
   A [revision details]
   M charmworld/routes.py
   M charmworld/views/api/__init__.py
   M charmworld/views/bundles.py
   M charmworld/views/tests/test_api.py
   M charmworld/views/tests/test_bundles.py
   M charmworld/views/tests/test_misc.py

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: tarmac-20131104185142-yu1k77h95eemcw1g
+New revision: <email address hidden>

Index: charmworld/routes.py
=== modified file 'charmworld/routes.py'
--- charmworld/routes.py 2013-10-29 19:59:01 +0000
+++ charmworld/routes.py 2013-11-04 20:52:52 +0000
@@ -54,13 +54,13 @@

      # Personal Bundles
      config.add_route("personal-bundle-json-revision",
- "/~{owner}/bundle/{basket}/{rev}/{bundle}/json")
+ "/bundle/~{owner}/{basket}/{rev}/{bundle}/json")
      config.add_route("personal-bundle-json",
- "/~{owner}/bundle/{basket}/{bundle}/json")
+ "/bundle/~{owner}/{basket}/{bundle}/json")
      config.add_route("personal-bundle-revision",
- "/~{owner}/bundle/{basket}/{rev}/{bundle}")
+ "/bundle/~{owner}/{basket}/{rev}/{bundle}")
      config.add_route("personal-bundle",
- "/~{owner}/bundle/{basket}/{bundle}")
+ "/bundle/~{owner}/{basket}/{bundle}")

      # Official (promulgated) Bundles
      config.add_route("official-bundle-json",

Index: charmworld/views/bundles.py
=== modified file 'charmworld/views/bundles.py'
--- charmworld/views/bundles.py 2013-10-29 19:59:01 +0000
+++ charmworld/views/bundles.py 2013-11-04 20:52:52 +0000
@@ -40,7 +40,7 @@
          for k, v in services.items():
              d = dict(name=k)
              for key in BundleDetail.service_keys:
- if key != 'options':
+ if key != 'option':
                      d[key] = v.get(key, u'')

              # Flatten options.

Index: charmworld/views/api/__init__.py
=== modified file 'charmworld/views/api/__init__.py'
--- charmworld/views/api/__init__.py 2013-10-24 22:04:01 +0000
+++ charmworld/views/api/__init__.py 2013-11-04 20:52:52 +0000
@@ -156,10 +156,10 @@
          }

      @classmethod
- def _bundle_result(cls, bundle, db):
+ def _bundle_result(cls, bundle, db, route_url):
          """Build standard metadata around a bundle search result."""
          bundle_obj = Bun...

442. By Richard Harding

Update per self-review

443. By Richard Harding

lint

Revision history for this message
Richard Harding (rharding) wrote :
Revision history for this message
Richard Harding (rharding) wrote :

Reviewer comments added.

https://codereview.appspot.com/21370044/diff/20001/charmworld/routes.py
File charmworld/routes.py (right):

https://codereview.appspot.com/21370044/diff/20001/charmworld/routes.py#newcode57
charmworld/routes.py:57:
"/bundle/~{owner}/{basket}/{rev}/{bundle}/json")
this could probably go into some sort of /bundle/*bits but leaving as
simple case of moving the url for the moment.

https://codereview.appspot.com/21370044/diff/20001/charmworld/views/api/__init__.py
File charmworld/views/api/__init__.py (right):

https://codereview.appspot.com/21370044/diff/20001/charmworld/views/api/__init__.py#newcode159
charmworld/views/api/__init__.py:159: def _bundle_result(cls, bundle,
db, route_url):
route_url is needed to build the url to the person bundle json route
we're providing as an endpoint for the deployer/quickstart to use.

https://codereview.appspot.com/21370044/diff/20001/charmworld/views/tests/test_api.py
File charmworld/views/tests/test_api.py (right):

https://codereview.appspot.com/21370044/diff/20001/charmworld/views/tests/test_api.py#newcode768
charmworld/views/tests/test_api.py:768: self.enable_routes()
because of the need to generate the route for the deployer_file_url we
need to enable routes on more tests.

https://codereview.appspot.com/21370044/diff/20001/charmworld/views/tests/test_api.py#newcode841
charmworld/views/tests/test_api.py:841:
u'http://example.com/bundle/%7Ebac/bat/4/byobu/json',
I'm so sorry, but the linter...he hates me.

https://codereview.appspot.com/21370044/diff/20001/charmworld/views/tests/test_api.py#newcode1585
charmworld/views/tests/test_api.py:1585: class TestAPI3(TestAPI,
API3Mixin):
remove the stupid Z. Just skipping the bad test for now. See later
files.

https://codereview.appspot.com/21370044/diff/20001/charmworld/views/tests/test_misc.py
File charmworld/views/tests/test_misc.py (right):

https://codereview.appspot.com/21370044/diff/20001/charmworld/views/tests/test_misc.py#newcode54
charmworld/views/tests/test_misc.py:54: self.skipTest("See bug
#1237025
")
Skipping this as the new enable_routes() caused it to fail over here for
no good reason. Will look at as a follow up after bundles are released.

https://codereview.appspot.com/21370044/

Revision history for this message
Benji York (benji) wrote :

LGTM

https://codereview.appspot.com/21370044/diff/20001/charmworld/routes.py
File charmworld/routes.py (right):

https://codereview.appspot.com/21370044/diff/20001/charmworld/routes.py#newcode57
charmworld/routes.py:57:
"/bundle/~{owner}/{basket}/{rev}/{bundle}/json")
On 2013/11/04 21:46:34, rharding wrote:
> this could probably go into some sort of /bundle/*bits but leaving as
simple
> case of moving the url for the moment.

If I'm understanding you correctly, I think I like it better this way.
It is easier to see the pattern matching spelled out in routes rather
than in code.

https://codereview.appspot.com/21370044/diff/20001/charmworld/views/api/__init__.py
File charmworld/views/api/__init__.py (right):

https://codereview.appspot.com/21370044/diff/20001/charmworld/views/api/__init__.py#newcode429
charmworld/views/api/__init__.py:429: 'personal-bundle-json-revision',
**route_info)
Since route_info isn't used subsequently, I don't see why it is created
instead of just passing its contents as keyword arguments.

https://codereview.appspot.com/21370044/diff/20001/charmworld/views/tests/test_api.py
File charmworld/views/tests/test_api.py (right):

https://codereview.appspot.com/21370044/diff/20001/charmworld/views/tests/test_api.py#newcode1
charmworld/views/tests/test_api.py:1: # Copyright<enter change
description here if sensible> 2012, 2013 Canonical
Something bad happened here.

https://codereview.appspot.com/21370044/diff/20001/charmworld/views/tests/test_api.py#newcode841
charmworld/views/tests/test_api.py:841:
u'http://example.com/bundle/%7Ebac/bat/4/byobu/json',
On 2013/11/04 21:46:34, rharding wrote:
> I'm so sorry, but the linter...he hates me.

Eww. That is bad.

It wouldn't accept the value being indented four more spaces?

https://codereview.appspot.com/21370044/diff/20001/charmworld/views/tests/test_api.py#newcode1585
charmworld/views/tests/test_api.py:1585: class TestAPI3(TestAPI,
API3Mixin):
On 2013/11/04 21:46:34, rharding wrote:
> remove the stupid Z. Just skipping the bad test for now. See later
files.

I like the explicitness of the new approach better.

https://codereview.appspot.com/21370044/

Revision history for this message
Richard Harding (rharding) wrote :

Thanks for the review. I made a couple of small updates.

https://codereview.appspot.com/21370044/diff/20001/charmworld/views/tests/test_api.py
File charmworld/views/tests/test_api.py (right):

https://codereview.appspot.com/21370044/diff/20001/charmworld/views/tests/test_api.py#newcode841
charmworld/views/tests/test_api.py:841:
u'http://example.com/bundle/%7Ebac/bat/4/byobu/json',
On 2013/11/05 12:55:46, benji wrote:
> On 2013/11/04 21:46:34, rharding wrote:
> > I'm so sorry, but the linter...he hates me.

> Eww. That is bad.

> It wouldn't accept the value being indented four more spaces?

No, it yelled about bad indentation. I was trapped between the line
length and the indentation fussing. I moved the string out into a
variable. I thought about it yesterday but it seemed ugly to me. Now
looking at it, it's much more sane.

https://codereview.appspot.com/21370044/diff/20001/charmworld/views/tests/test_api.py#newcode1585
charmworld/views/tests/test_api.py:1585: class TestAPI3(TestAPI,
API3Mixin):
On 2013/11/05 12:55:46, benji wrote:
> On 2013/11/04 21:46:34, rharding wrote:
> > remove the stupid Z. Just skipping the bad test for now. See later
files.

> I like the explicitness of the new approach better.

Thanks, removed the comments above as well. Missed that :/

https://codereview.appspot.com/21370044/

444. By Richard Harding

Updates per review

445. By Richard Harding

Fix the test for the basket/bundle order

Revision history for this message
Juju Gui Bot (juju-gui-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'charmworld/routes.py'
--- charmworld/routes.py 2013-10-29 19:59:01 +0000
+++ charmworld/routes.py 2013-11-05 15:01:02 +0000
@@ -54,13 +54,13 @@
5454
55 # Personal Bundles55 # Personal Bundles
56 config.add_route("personal-bundle-json-revision",56 config.add_route("personal-bundle-json-revision",
57 "/~{owner}/bundle/{basket}/{rev}/{bundle}/json")57 "/bundle/~{owner}/{basket}/{rev}/{bundle}/json")
58 config.add_route("personal-bundle-json",58 config.add_route("personal-bundle-json",
59 "/~{owner}/bundle/{basket}/{bundle}/json")59 "/bundle/~{owner}/{basket}/{bundle}/json")
60 config.add_route("personal-bundle-revision",60 config.add_route("personal-bundle-revision",
61 "/~{owner}/bundle/{basket}/{rev}/{bundle}")61 "/bundle/~{owner}/{basket}/{rev}/{bundle}")
62 config.add_route("personal-bundle",62 config.add_route("personal-bundle",
63 "/~{owner}/bundle/{basket}/{bundle}")63 "/bundle/~{owner}/{basket}/{bundle}")
6464
65 # Official (promulgated) Bundles65 # Official (promulgated) Bundles
66 config.add_route("official-bundle-json",66 config.add_route("official-bundle-json",
6767
=== modified file 'charmworld/views/api/__init__.py'
--- charmworld/views/api/__init__.py 2013-10-24 22:04:01 +0000
+++ charmworld/views/api/__init__.py 2013-11-05 15:01:02 +0000
@@ -156,10 +156,10 @@
156 }156 }
157157
158 @classmethod158 @classmethod
159 def _bundle_result(cls, bundle, db):159 def _bundle_result(cls, bundle, db, route_url):
160 """Build standard metadata around a bundle search result."""160 """Build standard metadata around a bundle search result."""
161 bundle_obj = Bundle(bundle)161 bundle_obj = Bundle(bundle)
162 bundle_metadata = cls._build_bundle_metadata(bundle_obj, db)162 bundle_metadata = cls._build_bundle_metadata(bundle_obj, db, route_url)
163 return {163 return {
164 'bundle': bundle_metadata,164 'bundle': bundle_metadata,
165 'metadata': {165 'metadata': {
@@ -414,11 +414,18 @@
414 return charm_id, trailing, charm414 return charm_id, trailing, charm
415415
416 @classmethod416 @classmethod
417 def _build_bundle_metadata(cls, bundle, db):417 def _build_bundle_metadata(cls, bundle, db, route_url):
418 bundle_dict = dict(bundle)418 bundle_dict = dict(bundle)
419 # Add the list of files in the bundle.419 # Add the list of files in the bundle.
420 bundle_dict['files'] = bundle.get_file_list(db)420 bundle_dict['files'] = bundle.get_file_list(db)
421 bundle_dict['charm_metadata'] = {}421 bundle_dict['charm_metadata'] = {}
422 bundle_dict['deployer_file_url'] = route_url(
423 'personal-bundle-json-revision',
424 basket=bundle_dict['basket_name'],
425 bundle=bundle_dict['name'],
426 owner=bundle_dict['owner'],
427 rev=bundle_dict['basket_revision'],
428 )
422 service_data = bundle_dict.get('data')429 service_data = bundle_dict.get('data')
423 # Now load the charm information we require for the services in the430 # Now load the charm information we require for the services in the
424 # bundle.431 # bundle.
@@ -515,7 +522,8 @@
515 result = {'type': 'no_such_bundle', 'bundle_id': '/'.join(path)}522 result = {'type': 'no_such_bundle', 'bundle_id': '/'.join(path)}
516 return json_response(status, result)523 return json_response(status, result)
517 if not trailing:524 if not trailing:
518 bundle = self._build_bundle_metadata(bundle, self.request.db)525 bundle = self._build_bundle_metadata(
526 bundle, self.request.db, self.request.route_url)
519 return json_response(200, bundle)527 return json_response(200, bundle)
520 elif trailing and '/'.join(trailing) == self.ICON_TRAILING:528 elif trailing and '/'.join(trailing) == self.ICON_TRAILING:
521 return self._bundle_icon(bundle)529 return self._bundle_icon(bundle)
@@ -697,7 +705,8 @@
697 if item['doctype'] == BUNDLE:705 if item['doctype'] == BUNDLE:
698 result = self._bundle_result(706 result = self._bundle_result(
699 Bundle(item['data'])._representation,707 Bundle(item['data'])._representation,
700 self.request.db)708 self.request.db,
709 self.request.route_url)
701 else:710 else:
702 result = self._charm_result(Charm(item['data']))711 result = self._charm_result(Charm(item['data']))
703 results.append(result)712 results.append(result)
704713
=== modified file 'charmworld/views/tests/test_api.py'
--- charmworld/views/tests/test_api.py 2013-10-25 01:16:39 +0000
+++ charmworld/views/tests/test_api.py 2013-11-05 15:01:02 +0000
@@ -1,5 +1,7 @@
1# Copyright 2012, 2013 Canonical Ltd. This software is licensed under the1# Copyright 2012, 2013 Canonical
2# GNU Affero General Public License version 3 (see the file LICENSE).2
3# Ltd. This software is licensed under the GNU Affero General Public License
4# version 3 (see the file LICENSE).
35
4__metaclass__ = type6__metaclass__ = type
57
@@ -764,6 +766,7 @@
764 self.get_response('bundle', remainder=None)766 self.get_response('bundle', remainder=None)
765767
766 def test_valid_lookup_unpromulgated(self):768 def test_valid_lookup_unpromulgated(self):
769 self.enable_routes()
767 self.makeBundle(name='bat', owner='bac', basket_with_rev='byobu/4')770 self.makeBundle(name='bat', owner='bac', basket_with_rev='byobu/4')
768 response = self.get_response('bundle', '~bac/byobu/4/bat')771 response = self.get_response('bundle', '~bac/byobu/4/bat')
769 self.assertEqual(200, response.status_code)772 self.assertEqual(200, response.status_code)
@@ -773,6 +776,7 @@
773 self.assertEqual(404, response.status_code)776 self.assertEqual(404, response.status_code)
774777
775 def test_valid_lookup_promulgated(self):778 def test_valid_lookup_promulgated(self):
779 self.enable_routes()
776 self.makeBundle(780 self.makeBundle(
777 name='bat', owner='bac', basket_with_rev='byobu/4',781 name='bat', owner='bac', basket_with_rev='byobu/4',
778 promulgated=True)782 promulgated=True)
@@ -785,6 +789,7 @@
785 self.assertEqual(200, response.status_code)789 self.assertEqual(200, response.status_code)
786790
787 def test_results_match(self):791 def test_results_match(self):
792 self.enable_routes()
788 # Make the charm that we'll use as a service.793 # Make the charm that we'll use as a service.
789 _id, charm = factory.makeCharm(794 _id, charm = factory.makeCharm(
790 self.db,795 self.db,
@@ -801,6 +806,7 @@
801 basket_with_rev='byobu/4', services=services)806 basket_with_rev='byobu/4', services=services)
802 response = self.get_response('bundle', '~bac/byobu/4/bat')807 response = self.get_response('bundle', '~bac/byobu/4/bat')
803 self.assertEqual(200, response.status_code)808 self.assertEqual(200, response.status_code)
809 deployer_url = u'http://example.com/bundle/%7Ebac/byobu/4/bat/json'
804 self.assertEqual(810 self.assertEqual(
805 response.json,811 response.json,
806 {812 {
@@ -832,6 +838,7 @@
832 u'permanent_url': u'bundle:~bac/byobu/4/bat',838 u'permanent_url': u'bundle:~bac/byobu/4/bat',
833 u'promulgated': False,839 u'promulgated': False,
834 u'title': u'',840 u'title': u'',
841 u'deployer_file_url': deployer_url,
835 })842 })
836843
837 def test_extracting_bundle_id_with_trailing_full_id(self):844 def test_extracting_bundle_id_with_trailing_full_id(self):
@@ -1572,10 +1579,7 @@
1572 return names1579 return names
15731580
15741581
1575# XXX: Rick Harding 2013-10-21:1582class TestAPI3(TestAPI, API3Mixin):
1576# Odd bug requires these tests to be run last, hence the Z in the name to
1577# force it to be last.
1578class TestZAPI3(TestAPI, API3Mixin):
1579 """Test API 3."""1583 """Test API 3."""
15801584
1581 def test_charms_path_notfound(self):1585 def test_charms_path_notfound(self):
@@ -1587,6 +1591,7 @@
15871591
1588 def test_search_results_contain_charms_and_bundles(self):1592 def test_search_results_contain_charms_and_bundles(self):
1589 self.use_index_client()1593 self.use_index_client()
1594 self.enable_routes()
1590 bundle = self.make_indexed_bundle(name='fan-stack-tic')1595 bundle = self.make_indexed_bundle(name='fan-stack-tic')
1591 charm = self.make_indexed_charm()1596 charm = self.make_indexed_charm()
1592 result = self.get_response(self.search_endpoint).json_body['result']1597 result = self.get_response(self.search_endpoint).json_body['result']
@@ -1605,6 +1610,7 @@
16051610
1606 def test_search_result_bundles_includes_metadata(self):1611 def test_search_result_bundles_includes_metadata(self):
1607 self.use_index_client()1612 self.use_index_client()
1613 self.enable_routes()
1608 _id, charm = factory.makeCharm(self.db, promulgated=True)1614 _id, charm = factory.makeCharm(self.db, promulgated=True)
1609 services = {1615 services = {
1610 u'charm': {1616 u'charm': {
@@ -1691,6 +1697,7 @@
16911697
1692 def test_search_interesting_contains_charms_and_bundles(self):1698 def test_search_interesting_contains_charms_and_bundles(self):
1693 self.use_index_client()1699 self.use_index_client()
1700 self.enable_routes()
1694 bundle = self.make_indexed_bundle(name='bat')1701 bundle = self.make_indexed_bundle(name='bat')
1695 FeaturedSource.from_db(self.db).set_featured(1702 FeaturedSource.from_db(self.db).set_featured(
1696 bundle._representation, BUNDLE)1703 bundle._representation, BUNDLE)
@@ -1705,10 +1712,7 @@
1705 self.assertItemsEqual(expected, list_names(result['featured']))1712 self.assertItemsEqual(expected, list_names(result['featured']))
17061713
17071714
1708# XXX: Rick Harding 2013-10-21:1715class TestAPI2(TestAPI, API2Mixin):
1709# Odd bug requires these tests to be run last, hence the Z in the name to
1710# force it to be last.
1711class TestZAPI2(TestAPI, API2Mixin):
1712 """Test API 2."""1716 """Test API 2."""
17131717
1714 def test_charms_passes_doctype(self):1718 def test_charms_passes_doctype(self):
17151719
=== modified file 'charmworld/views/tests/test_bundles.py'
--- charmworld/views/tests/test_bundles.py 2013-10-29 20:38:42 +0000
+++ charmworld/views/tests/test_bundles.py 2013-11-05 15:01:02 +0000
@@ -287,7 +287,7 @@
287 basket_with_rev=basket_with_rev, series='raring',287 basket_with_rev=basket_with_rev, series='raring',
288 )288 )
289 # Test that the route works.289 # Test that the route works.
290 path = '/~{owner}/bundle/{basket}/{bundle}'.format(290 path = '/bundle/~{owner}/{basket}/{bundle}'.format(
291 owner=owner, basket=basket, bundle=bundle_name)291 owner=owner, basket=basket, bundle=bundle_name)
292 resp = self.app.get(path, status=200)292 resp = self.app.get(path, status=200)
293 self.assertIn(bundle.owner, resp.body)293 self.assertIn(bundle.owner, resp.body)
@@ -308,7 +308,7 @@
308 self.db, name='gigis', owner='ladonna',308 self.db, name='gigis', owner='ladonna',
309 basket_with_rev='basket/1', series='raring',309 basket_with_rev='basket/1', series='raring',
310 )310 )
311 path = '/~ladonna/bundle/basket/1/gigis'311 path = '/bundle/~ladonna/basket/1/gigis'
312 response = self.app.get(path, status=200)312 response = self.app.get(path, status=200)
313 self.assertIn(313 self.assertIn(
314 'lp:~ladonna/charms/bundles/basket/bundle', response.body)314 'lp:~ladonna/charms/bundles/basket/bundle', response.body)
@@ -318,7 +318,7 @@
318 self.db, name='gigis', owner='ladonna',318 self.db, name='gigis', owner='ladonna',
319 basket_with_rev='basket/1', series='raring',319 basket_with_rev='basket/1', series='raring',
320 )320 )
321 path = '/~ladonna/bundle/basket/1/XXX'321 path = '/bundle/~ladonna/basket/1/XXX'
322 self.app.get(path, status=404)322 self.app.get(path, status=404)
323323
324 def test_personal_bundle_with_revision_json_route(self):324 def test_personal_bundle_with_revision_json_route(self):
@@ -328,7 +328,7 @@
328 self.db, name='gigis', owner='ladonna',328 self.db, name='gigis', owner='ladonna',
329 basket_with_rev='basket/1', series='raring',329 basket_with_rev='basket/1', series='raring',
330 )330 )
331 path = '/~ladonna/bundle/basket/1/gigis/json'331 path = '/bundle/~ladonna/basket/1/gigis/json'
332 resp = self.app.get(path, status=200)332 resp = self.app.get(path, status=200)
333 self.assertIn(bundle.data['series'], resp.body)333 self.assertIn(bundle.data['series'], resp.body)
334 self.assertIn(str(bundle.data['relations']), resp.body)334 self.assertIn(str(bundle.data['relations']), resp.body)
@@ -341,7 +341,7 @@
341 self.db, name='gigis', owner='lafawnda',341 self.db, name='gigis', owner='lafawnda',
342 basket_with_rev='basket/1', series='raring',342 basket_with_rev='basket/1', series='raring',
343 )343 )
344 path = '/~lafawnda/bundle/basket/gigis/json'344 path = '/bundle/~lafawnda/basket/gigis/json'
345 resp = self.app.get(path, status=200)345 resp = self.app.get(path, status=200)
346 self.assertIn(bundle.data['series'], resp.body)346 self.assertIn(bundle.data['series'], resp.body)
347 self.assertIn(str(bundle.data['relations']), resp.body)347 self.assertIn(str(bundle.data['relations']), resp.body)
@@ -352,7 +352,7 @@
352 self.db, name='gigis', owner='ladonna',352 self.db, name='gigis', owner='ladonna',
353 basket_with_rev='basket/1', series='raring',353 basket_with_rev='basket/1', series='raring',
354 )354 )
355 path = '/~ladonna/bundle/basket/1/XXX/json'355 path = '/bundle/~ladonna/basket/1/XXX/json'
356 self.app.get(path, status=404)356 self.app.get(path, status=404)
357357
358 def test_official_bundle_route(self):358 def test_official_bundle_route(self):
359359
=== modified file 'charmworld/views/tests/test_misc.py'
--- charmworld/views/tests/test_misc.py 2013-10-30 13:20:01 +0000
+++ charmworld/views/tests/test_misc.py 2013-11-05 15:01:02 +0000
@@ -46,6 +46,12 @@
4646
47 def test_homeview(self):47 def test_homeview(self):
48 """Make sure the home view renders correctly."""48 """Make sure the home view renders correctly."""
49 # XXX: #1237025 Rick Harding 2013-10-21:
50 # Unknown bug causes this test to fail if other tests enable the
51 # self.enable_routes(). Skipping this test and leaving the others.
52 # Leaving the bug as a reference to fix this failure. Passes when run
53 # in single suite, but fails in global `make test`.
54 self.skipTest("See bug #1237025")
49 resp = self.app.get(55 resp = self.app.get(
50 '/',56 '/',
51 status=200)57 status=200)

Subscribers

People subscribed via source and target branches

to all changes: