1
from unittest import TestCase
3
from jujuconfig import (
9
class TestDescribeSubstrate(TestCase):
11
def test_describe_substrate_kvm(self):
12
self.assertEqual('KVM (local)', describe_substrate(
13
{'type': 'local', 'container': 'kvm'}))
14
self.assertEqual('loca', describe_substrate(
15
{'type': 'loca', 'container': 'kvm'}))
17
def test_describe_substrate_lxc(self):
18
self.assertEqual('LXC (local)', describe_substrate(
19
{'type': 'local', 'container': 'lxc'}))
20
self.assertEqual('LXC (local)', describe_substrate(
23
def test_describe_substrate_openstack(self):
24
self.assertEqual('Openstack', describe_substrate(
25
{'type': 'openstack', 'auth-url': 'pcloudsvc.com:35357/v2.0/'}))
27
def test_describe_substrate_canonistack(self):
28
self.assertEqual('Canonistack', describe_substrate(
32
'https://keystone.canonistack.canonical.com:443/v2.0/'}))
34
def test_describe_substrate_aws(self):
35
self.assertEqual('AWS', describe_substrate({'type': 'ec2'}))
37
def test_describe_substrate_joyent(self):
38
self.assertEqual('Joyent', describe_substrate({'type': 'joyent'}))
40
def test_describe_substrate_azure(self):
41
self.assertEqual('Azure', describe_substrate({'type': 'azure'}))
43
def test_describe_substrate_maas(self):
44
self.assertEqual('MAAS', describe_substrate({'type': 'maas'}))
46
def test_describe_substrate_rackspace(self):
47
self.assertEqual('Rackspace',
48
describe_substrate({'type': 'rackspace'}))
51
class TestGetJenvPath(TestCase):
53
def test_get_jenv_path(self):
54
self.assertEqual('home/environments/envname.jenv',
55
get_jenv_path('home', 'envname'))