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

Subscribers

People subscribed via source and target branches

to all changes: