3
from backend import Backend
5
class TestBackends(unittest.TestCase):
7
As the number of configurations this charm supports increases it becomes
8
desirable to move to Strategy pattern objects to implement features
9
per backend. These tests insure the basic factory code works.
11
def backendNames(self, backend):
12
return [b.__class__.__name__ for b in backend.backends]
14
def test_get_python(self):
19
backend = Backend(config)
20
self.assertIn("nginx", backend.debs)
21
self.assertIn("haproxy", backend.debs)
22
self.assertIn("curl", backend.debs)
23
self.assertIn("openssl", backend.debs)
24
self.assertIn('zookeeper', backend.debs)
25
self.assertIn('ppa:juju-gui/ppa', backend.repositories)
26
self.assertIn('ImprovBackend', self.backendNames(backend))
27
self.assertNotIn('PythonBackend', self.backendNames(backend))
30
def test_get_python_sandbox(self):
35
backend = Backend(config)
36
self.assertIn("nginx", backend.debs)
37
self.assertNotIn('zookeeper', backend.debs)
38
self.assertNotIn('ImprovBackend', self.backendNames(backend))