from ..helpers import *

class TestFastly(object):
    def setup(self):
        self.collectd = MagicMock()
        self.modules = patch.dict('sys.modules', {'collectd': self.collectd})
        self.modules.start()

        from collectd_cdn import fastly
        self.fastly = fastly.CdnFastly()

    def teardown(self):
        self.modules.stop()

Patch sys.modules for collectd import
Patch sys.modules for collectd import

So that we can test the plugin independent of collectd.
