~james-page/charms/trusty/cinder/https-multi-network

« back to all changes in this revision

Viewing changes to unit_tests/test_utils.py

  • Committer: james.page at ubuntu
  • Date: 2014-10-01 22:07:44 UTC
  • mfrom: (45.1.1 cinder)
  • Revision ID: james.page@ubuntu.com-20141001220744-v35hu9iblt15phc7
Rebase and resync

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
        self.test_relation = TestRelation()
65
65
        self.patch_all()
66
66
 
 
67
    # FIXME: This is bad. These mocks will persist across all tests.
67
68
    def patch(self, method):
68
69
        _m = patch.object(self.obj, method)
69
70
        mock = _m.start()
80
81
    def __init__(self):
81
82
        self.config = get_default_config()
82
83
 
83
 
    def get(self, attr):
 
84
    def get(self, attr=None):
 
85
        if not attr:
 
86
            return self.config
84
87
        try:
85
88
            return self.config[attr]
86
89
        except KeyError: