Merge lp:~tvansteenburgh/charms/precise/apache2/fix-tests into lp:charms/apache2

Proposed by Tim Van Steenburgh
Status: Merged
Merged at revision: 59
Proposed branch: lp:~tvansteenburgh/charms/precise/apache2/fix-tests
Merge into: lp:charms/apache2
Diff against target: 70 lines (+15/-7)
3 files modified
Makefile (+10/-2)
hooks/hooks.py (+4/-4)
hooks/tests/test_nrpe_hooks.py (+1/-1)
To merge this branch: bzr merge lp:~tvansteenburgh/charms/precise/apache2/fix-tests
Reviewer Review Type Date Requested Status
Matt Bruzek (community) Approve
Review via email: mp+234161@code.launchpad.net

Description of the change

Fix test/lint errors.

To post a comment you must log in.
Revision history for this message
Matt Bruzek (mbruzek) wrote :

Hey Tim,

These changes to the Makefile look great! The bundletests pass now. Thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Makefile'
--- Makefile 2013-10-10 22:47:57 +0000
+++ Makefile 2014-09-10 17:35:54 +0000
@@ -17,9 +17,9 @@
17 @(charm proof $(PWD) || [ $$? -eq 100 ]) && echo OK17 @(charm proof $(PWD) || [ $$? -eq 100 ]) && echo OK
18 @test `cat revision` = 0 && rm revision18 @test `cat revision` = 0 && rm revision
1919
20test:20test: .venv
21 @echo Starting tests...21 @echo Starting tests...
22 @CHARM_DIR=$(CHARM_DIR) $(TEST_PREFIX) nosetests $(TEST_DIR)22 @CHARM_DIR=$(CHARM_DIR) $(TEST_PREFIX) .venv/bin/nosetests $(TEST_DIR)
2323
24lint:24lint:
25 @echo Checking for Python syntax...25 @echo Checking for Python syntax...
@@ -36,4 +36,12 @@
36 -d hooks/charmhelpers36 -d hooks/charmhelpers
37 @echo Do not forget to commit the updated files if any.37 @echo Do not forget to commit the updated files if any.
3838
39.venv:
40 sudo apt-get install python-virtualenv python-apt
41 virtualenv .venv --system-site-packages
42 .venv/bin/pip install -I nose testtools mock pyyaml
43
44clean:
45 rm -rf .venv
46
39.PHONY: revision proof test lint sourcedeps charm-payload47.PHONY: revision proof test lint sourcedeps charm-payload
4048
=== modified file 'hooks/hooks.py'
--- hooks/hooks.py 2014-06-28 19:26:04 +0000
+++ hooks/hooks.py 2014-09-10 17:35:54 +0000
@@ -68,9 +68,9 @@
68 dpkg.communicate(input=selections)68 dpkg.communicate(input=selections)
6969
7070
71#------------------------------------------------------------------------------71# -----------------------------------------------------------------------------
72# apt_get_purge( package ): Purges a package72# apt_get_purge( package ): Purges a package
73#------------------------------------------------------------------------------73# -----------------------------------------------------------------------------
74def apt_get_purge(packages=None):74def apt_get_purge(packages=None):
75 if packages is None:75 if packages is None:
76 return False76 return False
@@ -79,10 +79,10 @@
79 return subprocess.call(cmd_line)79 return subprocess.call(cmd_line)
8080
8181
82#------------------------------------------------------------------------------82# -----------------------------------------------------------------------------
83# service_apache2: Convenience function to start/stop/restart/reload83# service_apache2: Convenience function to start/stop/restart/reload
84# the apache2 service84# the apache2 service
85#------------------------------------------------------------------------------85# -----------------------------------------------------------------------------
86def service_apache2(action=None):86def service_apache2(action=None):
87 if action is None:87 if action is None:
88 return88 return
8989
=== modified file 'hooks/tests/test_nrpe_hooks.py'
--- hooks/tests/test_nrpe_hooks.py 2013-10-10 22:47:57 +0000
+++ hooks/tests/test_nrpe_hooks.py 2014-09-10 17:35:54 +0000
@@ -44,7 +44,7 @@
44 patcher = patch.object(data['object'], attr, create=create)44 patcher = patch.object(data['object'], attr, create=create)
45 self.patched[attr] = patcher.start()45 self.patched[attr] = patcher.start()
46 self.addCleanup(patcher.stop)46 self.addCleanup(patcher.stop)
47 if not 'JUJU_UNIT_NAME' in os.environ:47 if 'JUJU_UNIT_NAME' not in os.environ:
48 os.environ['JUJU_UNIT_NAME'] = 'test'48 os.environ['JUJU_UNIT_NAME'] = 'test'
4949
50 def check_call_counts(self, **kwargs):50 def check_call_counts(self, **kwargs):

Subscribers

People subscribed via source and target branches