Merge lp:~benji/charmworld/1263120-allow-self-referential-relations-in-bundles into lp:charmworld
Proposed by
Benji York
Status: | Merged |
---|---|
Approved by: | Benji York |
Approved revision: | 478 |
Merged at revision: | 479 |
Proposed branch: | lp:~benji/charmworld/1263120-allow-self-referential-relations-in-bundles |
Merge into: | lp:charmworld |
Diff against target: |
122 lines (+70/-6) 3 files modified
charmworld/lib/proof.py (+3/-0) charmworld/lib/tests/test_proof.py (+30/-4) charmworld/views/tests/test_proof.py (+37/-2) |
To merge this branch: | bzr merge lp:~benji/charmworld/1263120-allow-self-referential-relations-in-bundles |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Kapil Thangavelu (community) | Disapprove | ||
Juju Gui Bot | continuous-integration | Approve | |
Review via email: mp+202373@code.launchpad.net |
Commit message
Add a very useful hint about relation ordering.
Description of the change
Add a very useful hint about relation ordering.
To post a comment you must log in.
Reviewers: mp+202373_ code.launchpad. net,
Message:
Please take a look.
Description:
Add a very useful hint about relation ordering.
https:/ /code.launchpad .net/~benji/ charmworld/ 1263120- allow-self- referential- relations- in-bundles/ +merge/ 202373
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/54560044/
Affected files (+44, -7 lines): lib/proof. py lib/tests/ test_proof. py views/tests/ test_proof. py
A [revision details]
M charmworld/
M charmworld/
M charmworld/
Index: [revision details] 20140117153416- xbkyontzme0m6h8 2
=== 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-
+New revision: <email address hidden>
Index: charmworld/ lib/proof. py lib/proof. py' lib/proof. py 2014-01-13 18:31:15 +0000 lib/proof. py 2014-01-20 20:33:00 +0000
[('Endpoints are the same type on both services? ' +
str(same_ type)), ],
=== modified file 'charmworld/
--- charmworld/
+++ charmworld/
@@ -91,7 +91,8 @@
if not exist or not same_type:
# Then this definition is invalid.
msg = ('The requested relation %s to %s is incompatible between '
- 'services.')
+ 'services. Hint: if order of the relation were reversed
it '
+ 'would be valid.')
raise ProofError(
Index: charmworld/ lib/tests/ test_proof. py lib/tests/ test_proof. py' lib/tests/ test_proof. py 2014-01-13 18:31:15 +0000 lib/tests/ test_proof. py 2014-01-20 20:45:50 +0000
requires,
provides)
=== modified file 'charmworld/
--- charmworld/
+++ charmworld/
@@ -308,10 +308,9 @@
- msg = ('The requested relation db to cache is incompatible
exc.exception. msg
self. assertEqual(
between '
- 'services.')
- self.assertEqual(
- msg,
+ self.assertIn(
+ 'The requested relation db to cache is incompatible between '
+ 'services.',
)
Index: charmworld/ views/tests/ test_proof. py views/tests/ test_proof. py' views/tests/ test_proof. py 2014-01-14 19:24:49 +0000 views/tests/ test_proof. py 2014-01-20 20:33:00 +0000
=== modified file 'charmworld/
--- charmworld/
+++ charmworld/
@@ -12,8 +12,8 @@
"""Verify that a bundle can be proofed in charmworld."""
def setup_relatable _charms( self, second_requires, second_provides):
self.db,
description= '',
'wiki: The requested relation db to proxy is incompatible',
response. json_body[ 'error_ messages' ][0])
- # The default charm provides website:https and requires
- # database:mongodb
+ # Unless otherwise specified, the generated charm provides
+ # website:https and requires database:mongodb.
_id, charm_one = factory.makeCharm(
@@ -278,6 +278,41 @@
+ def test_reverse_ relation_ order(self) :
+ # Relations must be provided in (provides, requires) order. If a
+ # reverse relation would have worked, a nice error message tells
you
+ # so.
+ ...