Merge lp:~mbruzek/charms/precise/byobu-classroom/tests into lp:charms/byobu-classroom

Proposed by Matt Bruzek
Status: Merged
Merged at revision: 14
Proposed branch: lp:~mbruzek/charms/precise/byobu-classroom/tests
Merge into: lp:charms/byobu-classroom
Diff against target: 51 lines (+41/-0)
2 files modified
tests/00-setup (+5/-0)
tests/10-deploy (+36/-0)
To merge this branch: bzr merge lp:~mbruzek/charms/precise/byobu-classroom/tests
Reviewer Review Type Date Requested Status
charmers Pending
Review via email: mp+240892@code.launchpad.net

Commit message

Adding tests for this charm.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'tests'
=== added file 'tests/00-setup'
--- tests/00-setup 1970-01-01 00:00:00 +0000
+++ tests/00-setup 2014-11-06 16:32:32 +0000
@@ -0,0 +1,5 @@
1#!/bin/bash
2
3sudo add-apt-repository ppa:juju/stable -y
4sudo apt-get update
5sudo apt-get install amulet python-requests -y
06
=== added file 'tests/10-deploy'
--- tests/10-deploy 1970-01-01 00:00:00 +0000
+++ tests/10-deploy 2014-11-06 16:32:32 +0000
@@ -0,0 +1,36 @@
1#!/usr/bin/env python3
2
3import amulet
4import requests
5import unittest
6
7
8class TestDeployment(unittest.TestCase):
9 @classmethod
10 def setUpClass(cls):
11 cls.deployment = amulet.Deployment(series='precise')
12
13 cls.deployment.add('byobu-classroom')
14 cls.deployment.expose('byobu-classroom')
15
16 try:
17 cls.deployment.setup(timeout=900)
18 cls.deployment.sentry.wait()
19 except amulet.helpers.TimeoutError:
20 amulet.raise_status(
21 amulet.SKIP, msg="Environment wasn't stood up in time")
22 except:
23 raise
24
25 cls.byobu = cls.deployment.sentry['byobu-classroom/0']
26
27 def test_deployed(self):
28 self.assertTrue(self.deployment.deployed)
29
30 def test_webpage_available(self):
31 page = requests.get(
32 'http://{}'.format(self.byobu.info['public-address'])).text
33 self.assertTrue('Ajaxterm' in page)
34
35if __name__ == '__main__':
36 unittest.main()

Subscribers

People subscribed via source and target branches

to all changes: