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

« back to all changes in this revision

Viewing changes to tests/test_assess_spaces_subnets.py

  • Committer: Curtis Hovey
  • Date: 2015-12-20 15:14:05 UTC
  • Revision ID: curtis@canonical.com-20151220151405-pm3dauunjr2978gz
skip any client-server that starts with 1.26.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
import assess_spaces_subnets as jss
13
13
from jujupy import (
14
14
    EnvJujuClient,
15
 
    JujuData,
 
15
    SimpleEnvironment,
16
16
    Status,
17
17
    )
18
18
 
130
130
            self.add_machine(args)
131
131
 
132
132
        elif cmd == 'ssh':
133
 
            if args[1] in self._ssh_machine_output:
134
 
                ssh_output = self._ssh_machine_output[args[1]]
 
133
            if args[0] in self._ssh_machine_output:
 
134
                ssh_output = self._ssh_machine_output[args[0]]
135
135
            else:
136
136
                ssh_output = self._ssh_output
137
137
 
144
144
                # If we ran out of values, just return the last one
145
145
                return ssh_output[-1]
146
146
 
147
 
        elif cmd == 'add-space':
 
147
        elif cmd == 'space create':
148
148
            self._spaces[args] = []
149
 
        elif cmd == 'list-space':
 
149
        elif cmd == 'space list':
150
150
            return yaml.dump({'spaces': self._spaces})
151
 
        elif cmd == 'add-subnet':
 
151
        elif cmd == 'subnet add':
152
152
            subnet = '10.{}.0.0/16'.format(self._subnet_count)
153
153
            self._subnet_count += 1
154
154
 
210
210
class JujuMockTestCase(TestCase):
211
211
    def setUp(self):
212
212
        self.client = EnvJujuClient(
213
 
            JujuData('foo', {'type': 'local'}), '1.234-76', None)
 
213
            SimpleEnvironment('foo', {'type': 'local'}), '1.234-76', None)
214
214
 
215
215
        def nil_func():
216
216
            return None