~niedbalski/charm-helpers/fetch_is-package-installed

« back to all changes in this revision

Viewing changes to tests/contrib/ansible/test_ansible.py

  • Committer: Michael Nelson
  • Date: 2014-04-08 14:55:46 UTC
  • mfrom: (136.2.5 fresh-relations)
  • Revision ID: michael.nelson@canonical.com-20140408145546-n74be213bcqt115t
[r=bloodearnest] Simplify the relations dict provided in the ansible helpers to just use hookenv.relations() and add current_relation to context.

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
        self.mock_relation_get = patcher.start()
84
84
        self.mock_relation_get.return_value = {}
85
85
        self.addCleanup(patcher.stop)
 
86
        patcher = mock.patch('charmhelpers.core.hookenv.relations')
 
87
        self.mock_relations = patcher.start()
 
88
        self.mock_relations.return_value = {
 
89
            'wsgi-file': {},
 
90
            'website': {},
 
91
            'nrpe-external-master': {},
 
92
        }
 
93
        self.addCleanup(patcher.stop)
86
94
        patcher = mock.patch('charmhelpers.core.hookenv.relations_of_type')
87
95
        self.mock_relations_of_type = patcher.start()
88
96
        self.mock_relations_of_type.return_value = []
149
157
                "private_address": "10.10.10.10",
150
158
                "charm_dir": "",
151
159
                "local_unit": {},
152
 
                'relations': {'wsgi_file': []},
 
160
                'relations_deprecated': {'wsgi_file': []},
 
161
                'current_relation': {
 
162
                    'relation_key1': 'relation_value1',
 
163
                    'relation-key2': 'relation_value2',
 
164
                },
 
165
                'relations': {
 
166
                    'nrpe-external-master': {},
 
167
                    'website': {},
 
168
                    'wsgi-file': {},
 
169
                },
153
170
                "wsgi_file__relation_key1": "relation_value1",
154
171
                "wsgi_file__relation_key2": "relation_value2",
155
172
                "unit_private_address": "10.0.3.2",