21
16
class TestCharm(unittest.TestCase):
24
# juju('destroy-service', 'postgresql')
25
# juju('destroy-service', 'python-django')
26
# juju('destroy-service', 'gunicorn')
19
juju('destroy-service', 'postgresql')
20
juju('destroy-service', 'python-django')
21
juju('destroy-service', 'gunicorn')
28
23
def deploy(self, charm_config=None):
29
24
if charm_config is not None:
30
25
charm_config_file = make_charm_config_file(charm_config)
31
juju('deploy', '--repository', '../', 'local:postgresql')
32
juju('deploy', '--repository', '../', '--config=' + charm_config_file.name, 'local:python-django')
26
juju('deploy', 'postgresql')
27
juju('deploy', '--config=' + charm_config_file.name, 'python-django')
33
28
juju('deploy', 'gunicorn')
34
29
juju('add-relation', 'python-django:db', 'postgresql:db')
35
30
juju('add-relation', 'python-django', 'gunicorn')
54
47
self.deploy(self.get_config())
55
48
self.expose_and_check_page()
57
# def test_lpbuildbot(self):
58
# Deploying a Launchpad-specific buildbot master does a good job of
59
# exercising the configuration parameters. For example, the
60
# configuration in this test adds a repository (lucid main universe),
61
# installs a non-default buildbot package, and fetches the buildbot
62
# configuration from bzr.
67
# self.deploy(charm_config)
68
# self.expose_and_check_page()
70
# def test_upgrade_charm(self):
71
# Ensure the charm can be upgraded without errors.
72
# self.deploy(self.get_config())
73
# with maintain_charm_revision():
74
# upgrade_charm('python-django')
75
# Wait for the charm to upgrade using sleep, since there is no
76
# other confirmation at the moment but the state to remain 'started'.
78
# self.expose_and_check_page()
81
50
if __name__ == '__main__':