~smoser/ubuntu/vivid/cloud-init/snappy

« back to all changes in this revision

Viewing changes to tests/unittests/test_cs_util.py

  • Committer: Scott Moser
  • Date: 2015-02-27 20:55:58 UTC
  • mfrom: (355.2.8 vivid)
  • Revision ID: smoser@ubuntu.com-20150227205558-glrwdgxqkaz6zyxa
* Merge with vivid at 0.7.7~bzr1067-0ubuntu1
* New upstream snapshot.
  * fix broken consumption of gzipped user-data (LP: #1424900)
  * functional user-data on Azure again (LP: #1423972)
  * CloudStack: support fetching password from virtual router (LP: #1422388)
* New upstream snapshot.
  * Fix for ascii decode in DataSourceAzure (LP: #1422993).
* New upstream snapshot.
  * support for gpt partitioning, utilized in Azure [Daniel Watkins]
  * fix bug in exception handling in mount_cb.
* New upstream snapshot.
  * move to python3 (LP: #1247132)
  * systemd: run cloud-init before systemd-user-sessions.service
  * Use the GCE short hostname. (LP: #1383794)
  * Enable user-data encoding support for GCE. (LP: #1404311)
  * Update to use a newer and better OMNIBUS_URL
  * Be more tolerant of 'ssh_authorized_keys' types
  * Fix parse_ssh_config failing in ssh_util.py
  * Increase the robustness/configurability of the chef module.
  * retain trailing newline from template files when using
    jinja2 (LP: #1355343)
  * fix broken output handling (LP: #1387340)
  * digital ocean datasource
  * update url in config drive documentation
  * freebsd: enable correct behavior on Ec2.
  * freebsd: Use the proper virtio FreeBSD network interface name.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
from mocker import MockerTestCase
 
1
from __future__ import print_function
 
2
 
 
3
import sys
 
4
import unittest
2
5
 
3
6
from cloudinit.cs_utils import Cepko
4
7
 
 
8
try:
 
9
    skip = unittest.skip
 
10
except AttributeError:
 
11
    # Python 2.6.  Doesn't have to be high fidelity.
 
12
    def skip(reason):
 
13
        def decorator(func):
 
14
            def wrapper(*args, **kws):
 
15
                print(reason, file=sys.stderr)
 
16
            return wrapper
 
17
        return decorator
 
18
 
5
19
 
6
20
SERVER_CONTEXT = {
7
21
    "cpu": 1000,
26
40
        return SERVER_CONTEXT['tags']
27
41
 
28
42
 
29
 
class CepkoResultTests(MockerTestCase):
 
43
# 2015-01-22 BAW: This test is completely useless because it only ever tests
 
44
# the CepkoMock object.  Even in its original form, I don't think it ever
 
45
# touched the underlying Cepko class methods.
 
46
@skip('This test is completely useless')
 
47
class CepkoResultTests(unittest.TestCase):
30
48
    def setUp(self):
31
 
        self.mocked = self.mocker.replace("cloudinit.cs_utils.Cepko",
32
 
                            spec=CepkoMock,
33
 
                            count=False,
34
 
                            passthrough=False)
35
 
        self.mocked()
36
 
        self.mocker.result(CepkoMock())
37
 
        self.mocker.replay()
38
 
        self.c = Cepko()
 
49
        pass
 
50
        # self.mocked = self.mocker.replace("cloudinit.cs_utils.Cepko",
 
51
        #                     spec=CepkoMock,
 
52
        #                     count=False,
 
53
        #                     passthrough=False)
 
54
        # self.mocked()
 
55
        # self.mocker.result(CepkoMock())
 
56
        # self.mocker.replay()
 
57
        # self.c = Cepko()
39
58
 
40
59
    def test_getitem(self):
41
60
        result = self.c.all()