Merge lp://staging/~fwereade/pyjuju/add-upstart-class into lp://staging/pyjuju
Proposed by
William Reade
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Kapil Thangavelu | ||||
Approved revision: | 446 | ||||
Merged at revision: | 459 | ||||
Proposed branch: | lp://staging/~fwereade/pyjuju/add-upstart-class | ||||
Merge into: | lp://staging/pyjuju | ||||
Prerequisite: | lp://staging/~fwereade/pyjuju/fix-charm-upgrade | ||||
Diff against target: |
427 lines (+375/-1) 7 files modified
juju/errors.py (+3/-0) juju/lib/tests/data/test_basic_install (+10/-0) juju/lib/tests/data/test_less_basic_install (+11/-0) juju/lib/tests/data/test_standard_install (+10/-0) juju/lib/tests/test_upstart.py (+229/-0) juju/lib/upstart.py (+105/-0) juju/tests/test_errors.py (+7/-1) |
||||
To merge this branch: | bzr merge lp://staging/~fwereade/pyjuju/add-upstart-class | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Kapil Thangavelu (community) | Approve | ||
Jim Baker (community) | Approve | ||
Review via email: mp+85335@code.staging.launchpad.net |
Description of the change
This is just the class we will be using in lp:~fwereade/juju/upstartify-services, but extracted so as to make the diffs a little less daunting.
To post a comment you must log in.
+1. Just minors here:
[1]
+description "blah" n-failure --no-ideas
+author "Juju Team <email address hidden>"
+
+start on runlevel [2345]
+stop on runlevel [!2345]
+respawn
+
+env BLAH="blah blah"
+
+exec /bin/imaginatio
Having a generating family of dummy data (eg your Star Wars theme or really whatever)
can be helpful for seeing the expected patterns. "blah blah" is unfortunately
just too much noise when looking at these tests.
The other thing is that putting these files inline might work much better, to avoid one
more place to look to see what the expected output should be.
[2]
+class UpstartServiceT est(TestCase) : join(self. root, "etc", "init") init_dir) join(init_ dir, "some-name.conf") UpstartService, "root_path", self.root) "some-name" )
+
+ def setUp(self):
+ self.root = self.makeDir()
+ init_dir = os.path.
+ os.makedirs(
+ self.conf = os.path.
+ self.patch(
+ self.service = UpstartService(
It's unlikely this will be mixed in with other tests, but it's likely best to preserve
the existing cooperative super inheritance support, including returning a Deferred
(usually by inlineCallbacks).
[3]
+ def test_is_ installed( self):
Doc strings for tests!
+ self.assertFals e(self. service. is_installed( )) dummy_conf( ) (self.service. is_installed( ))
+ self.write_
+ self.assertTrue
+
[4]
+ @inlineCallbacks running( self):
+ def test_is_
Docs/comments especially here. Best to be explicit about how the mocks are
setting things up, especially when there's a sequence of multiple calls as seen here.