~adam-collard/landscape-charm/install-sources-keys

« back to all changes in this revision

Viewing changes to lib/tests/stubs.py

  • Committer: Adam Collard
  • Date: 2019-01-17 14:23:49 UTC
  • Revision ID: adam.collard@canonical.com-20190117142349-wpa73ajz9svtjpwm
392 alive again

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
class FetchStub(object):
108
108
    """Provide a testable stub for C{charmhelpers.fetch}."""
109
109
 
110
 
    def __init__(self):
 
110
    def __init__(self, config):
 
111
        self._config = config
 
112
        self.configured_sources = []
111
113
        self.sources = []
112
114
        self.updates = []
113
115
        self.filtered = []
126
128
    def apt_install(self, packages, options=None, fatal=False):
127
129
        self.installed.append((packages, options, fatal))
128
130
 
 
131
    def configure_sources(self):
 
132
        install_sources = self._config().get('install_sources')
 
133
        install_keys = self._config().get('install_keys')
 
134
        self.configured_sources.append((install_sources, install_keys))
 
135
 
129
136
 
130
137
class HostStub(object):
131
138
    """Testable stub for C{charmhelpers.core.host}."""