~gary/charms/oneiric/buildbot-master/dynamic-relationship

« back to all changes in this revision

Viewing changes to tests/buildbot-master.test

  • Committer: Benji York
  • Date: 2012-02-02 18:35:04 UTC
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: benji@benjiyork.com-20120202183504-ei87ouuzip0i3c1g
add some docs and spiff up the tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/python
2
2
 
3
 
from helpers import command, run
 
3
from helpers import command, run, unit_info
 
4
import time
4
5
import unittest
5
6
 
6
7
juju = command('juju')
8
9
class testCharm(unittest.TestCase):
9
10
 
10
11
    def testDeploy(self):
11
 
        juju('deploy', 'buildbot-master')
 
12
        try:
 
13
            juju('deploy', 'buildbot-master')
 
14
            while True:
 
15
                status = unit_info('buildbot-master', 'state')
 
16
                if 'error' in status or status == 'started':
 
17
                    break
 
18
                time.sleep(0.1)
 
19
            self.assertEqual(unit_info('buildbot-master', 'state'), 'started')
 
20
        finally:
 
21
            juju('destroy-service', 'buildbot-master')
 
22
 
12
23
 
13
24
if __name__ == '__main__':
14
25
    unittest.main()
15