@@ -0,0 +1,1971 @@
+import sys%0Aimport mock%0A%0Acharmhelpers = None%0Aapt_pkg = None%0A%0A%0Adef mock_charmhelpers():%0A    # Mock out charmhelpers so that we can test without it.%0A    # also stops sideeffects from occuring.%0A    global charmhelpers%0A    global apt_pkg%0A    charmhelpers = mock.MagicMock()%0A    apt_pkg = mock.MagicMock()%0A    sys.modules%5B'apt_pkg'%5D = apt_pkg%0A    sys.modules%5B'charmhelpers'%5D = charmhelpers%0A    sys.modules%5B'charmhelpers.core'%5D = charmhelpers.core%0A    sys.modules%5B'charmhelpers.core.hookenv'%5D = charmhelpers.core.hookenv%0A    sys.modules%5B'charmhelpers.core.host'%5D = charmhelpers.core.host%0A    sys.modules%5B'charmhelpers.core.unitdata'%5D = charmhelpers.core.unitdata%0A    sys.modules%5B'charmhelpers.core.templating'%5D = charmhelpers.core.templating%0A    sys.modules%5B'charmhelpers.contrib'%5D = charmhelpers.contrib%0A    sys.modules%5B'charmhelpers.contrib.openstack'%5D = (%0A        charmhelpers.contrib.openstack)%0A    sys.modules%5B'charmhelpers.contrib.openstack.utils'%5D = (%0A        charmhelpers.contrib.openstack.utils)%0A    sys.modules%5B'charmhelpers.contrib.openstack.templating'%5D = (%0A        charmhelpers.contrib.openstack.templating)%0A    sys.modules%5B'charmhelpers.contrib.network'%5D = charmhelpers.contrib.network%0A    sys.modules%5B'charmhelpers.contrib.network.ip'%5D = (%0A        charmhelpers.contrib.network.ip)%0A    sys.modules%5B'charmhelpers.fetch'%5D = charmhelpers.fetch%0A    sys.modules%5B'charmhelpers.cli'%5D = charmhelpers.cli%0A    sys.modules%5B'charmhelpers.contrib.hahelpers'%5D = (%0A        charmhelpers.contrib.hahelpers)%0A    sys.modules%5B'charmhelpers.contrib.hahelpers.cluster'%5D = (%0A        charmhelpers.contrib.hahelpers.cluster)%0A%0A    # mock in the openstack releases so that the tests can run%0A    charmhelpers.contrib.openstack.utils.OPENSTACK_RELEASES = (%0A        'diablo',%0A        'essex',%0A        'folsom',%0A        'grizzly',%0A        'havana',%0A        'icehouse',%0A        'juno',%0A        'kilo',%0A        'liberty',%0A        'mitaka',%0A        'newton',%0A        'ocata',%0A        'pike',%0A    )%0A

Add a test_mocks to mock charmhelpers centrally