Ejemplo n.º 1
0
    def setup(self):
        BuildTestHelper.setup(self)

        # Test the timestamp updater with cache disabled, so that the
        # BundleDefUpdater() base class won't interfere.
        self.m.cache = False
        self.m.updater = "timestamp"
Ejemplo n.º 2
0
    def setup(self):
        BuildTestHelper.setup(self)

        class CustomUpdater(object):
            allow = True
            def __call__(self, *a, **kw):
                return self.allow
        self.m.updater = CustomUpdater()
Ejemplo n.º 3
0
    def setup(self):
        BuildTestHelper.setup(self)

        class CustomUpdater(BaseUpdater):
            allow = True
            def needs_rebuild(self, *a, **kw):
                return self.allow
        self.m.updater = CustomUpdater()
Ejemplo n.º 4
0
    def setup(self):
        BuildTestHelper.setup(self)

        class CustomUpdater(object):
            allow = True
            def __call__(self, *a, **kw):
                return self.allow
        self.updater = CustomUpdater()
        settings.ASSETS_UPDATER = self.updater
Ejemplo n.º 5
0
    def setup(self):
        BuildTestHelper.setup(self)

        class CustomUpdater(object):
            allow = True

            def __call__(self, *a, **kw):
                return self.allow

        self.m.updater = CustomUpdater()
Ejemplo n.º 6
0
    def setup(self):
        BuildTestHelper.setup(self)

        self.m.expire = False

        self.build_called = build_called = []
        env = self.m
        class MockBundle(Bundle):
            def __init__(self, *a, **kw):
                Bundle.__init__(self, *a, **kw)
                self.env = env
            def _build(self, *a, **kw):
                build_called.append(self.output)
        self.MockBundle = MockBundle
Ejemplo n.º 7
0
    def setup(self):
        BuildTestHelper.setup(self)

        settings.ASSETS_EXPIRE = False

        self.files_built = files_built = []
        self.no_filter_values = no_filter_values = []
        class MockBundle(Bundle):
            def build(self, *a, **kw):
                if not self.output:
                    raise BuildError('no output')
                files_built.append(self.output)
                no_filter_values.append(kw.get('no_filters', False))
        self.MockBundle = MockBundle
Ejemplo n.º 8
0
    def setup(self):
        BuildTestHelper.setup(self)

        self.m.expire = False

        self.files_built = files_built = []
        self.no_filter_values = no_filter_values = []
        env = self.m
        class MockBundle(Bundle):
            def __init__(self, *a, **kw):
                Bundle.__init__(self, *a, **kw)
                self.env = env
            def build(self, *a, **kw):
                if not self.output:
                    raise BuildError('no output')
                files_built.append(self.output)
                no_filter_values.append(kw.get('no_filters', False))
        self.MockBundle = MockBundle
Ejemplo n.º 9
0
    def setup(self):
        BuildTestHelper.setup(self)

        class MyCache(BaseCache):
            def __init__(self):
                self.enabled = False
                self.reset()
            def get(self, key):
                self.getops += 1
                if self.enabled:
                    return 'foo'
                return False
            def set(self, key, data):
                self.setops += 1
            def reset(self):
                self.getops = 0
                self.setops = 0

        self.m.cache = self.cache = MyCache()
        self.m.debug = True
Ejemplo n.º 10
0
    def setup(self):
        BuildTestHelper.setup(self)

        class MyCache(BaseCache):
            def __init__(self):
                self.enabled = False
                self.reset()
            def get(self, key):
                self.getops += 1
                if self.enabled:
                    return 'foo'
                return False
            def set(self, key, data):
                self.setops += 1
            def reset(self):
                self.getops = 0
                self.setops = 0

        self.m.cache = self.cache = MyCache()
        # Note that updater will use the cache also
        self.m.updater = 'timestamp'
Ejemplo n.º 11
0
    def setup(self):
        BuildTestHelper.setup(self)

        self.m.expire = False

        self.files_built = files_built = []
        self.no_filter_values = no_filter_values = []
        env = self.m

        class MockBundle(Bundle):
            def __init__(self, *a, **kw):
                Bundle.__init__(self, *a, **kw)
                self.env = env

            def build(self, *a, **kw):
                if not self.output:
                    raise BuildError('no output')
                files_built.append(self.output)
                no_filter_values.append(kw.get('no_filters', False))

        self.MockBundle = MockBundle
Ejemplo n.º 12
0
    def setup(self):
        BuildTestHelper.setup(self)

        class MyCache(BaseCache):
            def __init__(self):
                self.enabled = False
                self.reset()

            def get(self, key):
                self.getops += 1
                if self.enabled:
                    return 'foo'
                return False

            def set(self, key, data):
                self.setops += 1

            def reset(self):
                self.getops = 0
                self.setops = 0

        self.m.cache = self.cache = MyCache()
        self.m.debug = True
Ejemplo n.º 13
0
 def setup(self):
     BuildTestHelper.setup(self)
     mock_opener = urllib2.build_opener(MockHTTPHandler({
         'http://foo': 'function() {}'}))
     urllib2.install_opener(mock_opener)
Ejemplo n.º 14
0
 def setup(self):
     if not find_executable('compass'):
         raise SkipTest()
     BuildTestHelper.setup(self)
Ejemplo n.º 15
0
 def setup(self):
     BuildTestHelper.setup(self)
     mock_opener = urllib2.build_opener(
         MockHTTPHandler({'http://foo': 'function() {}'}))
     urllib2.install_opener(mock_opener)
Ejemplo n.º 16
0
 def setup(self):
     BuildTestHelper.setup(self)