~abentley/juju-ci-tools/client-from-config-4

« back to all changes in this revision

Viewing changes to tests/test_jujuconfig.py

  • Committer: Aaron Bentley
  • Date: 2014-02-24 17:18:29 UTC
  • mto: This revision was merged to the branch mainline in revision 252.
  • Revision ID: aaron.bentley@canonical.com-20140224171829-sz644yhoygu7m9dm
Use tags to identify and shut down instances.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
from unittest import TestCase
2
 
 
3
 
from jujuconfig import (
4
 
    describe_substrate,
5
 
    get_jenv_path,
6
 
)
7
 
 
8
 
 
9
 
class TestDescribeSubstrate(TestCase):
10
 
 
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'}))
16
 
 
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(
21
 
            {'type': 'local'}))
22
 
 
23
 
    def test_describe_substrate_openstack(self):
24
 
        self.assertEqual('Openstack', describe_substrate(
25
 
            {'type': 'openstack', 'auth-url': 'pcloudsvc.com:35357/v2.0/'}))
26
 
 
27
 
    def test_describe_substrate_canonistack(self):
28
 
        self.assertEqual('Canonistack', describe_substrate(
29
 
            {
30
 
                'type': 'openstack',
31
 
                'auth-url':
32
 
                'https://keystone.canonistack.canonical.com:443/v2.0/'}))
33
 
 
34
 
    def test_describe_substrate_aws(self):
35
 
        self.assertEqual('AWS', describe_substrate({'type': 'ec2'}))
36
 
 
37
 
    def test_describe_substrate_joyent(self):
38
 
        self.assertEqual('Joyent', describe_substrate({'type': 'joyent'}))
39
 
 
40
 
    def test_describe_substrate_azure(self):
41
 
        self.assertEqual('Azure', describe_substrate({'type': 'azure'}))
42
 
 
43
 
    def test_describe_substrate_maas(self):
44
 
        self.assertEqual('MAAS', describe_substrate({'type': 'maas'}))
45
 
 
46
 
    def test_describe_substrate_rackspace(self):
47
 
        self.assertEqual('Rackspace',
48
 
                         describe_substrate({'type': 'rackspace'}))
49
 
 
50
 
 
51
 
class TestGetJenvPath(TestCase):
52
 
 
53
 
    def test_get_jenv_path(self):
54
 
        self.assertEqual('home/environments/envname.jenv',
55
 
                         get_jenv_path('home', 'envname'))