def setup(self): try: import scss self.scss = scss except ImportError: raise SkipTest() TempEnvironmentHelper.setup(self)
def setup(self): TempEnvironmentHelper.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 class CompleteFilter(Filter): # Support all possible filter operations def input(self, *a, **kw): pass output = open = concat = input self.filter = CompleteFilter self.env.cache = self.cache = MyCache() self.env.manifest = None # Note that updater will use the cache also self.env.updater = TimestampUpdater()
def setup(self): try: import closure except ImportError: raise SkipTest() TempEnvironmentHelper.setup(self)
def setup(self): TempEnvironmentHelper.setup(self) # Test the timestamp updater with cache disabled, so that the # BundleDefUpdater() base class won't interfere. self.env.cache = False self.env.updater = self.updater = TimestampUpdater()
def setup(self): TempEnvironmentHelper.setup(self) class CustomUpdater(BaseUpdater): allow = True def needs_rebuild(self, *a, **kw): return self.allow self.m.updater = CustomUpdater()
def setup(self): TempEnvironmentHelper.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
def setup(self): TempEnvironmentHelper.setup(self) self.app = Flask(__name__, static_path='/app_static') import test_module if not Blueprint: self.module = Module(test_module.__name__, name='module', static_path='/mod_static') self.app.register_module(self.module) else: self.blueprint = Blueprint('module', test_module.__name__, static_url_path='/mod_static', static_folder='static') self.app.register_blueprint(self.blueprint) self.env = Environment(self.app)
def setup(self): TempEnvironmentHelper.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'
def test_callable_filter(): """Simple callables can be used as filters. Regression: Ensure that they actually work. """ # Note how this filter specifically does not receive any **kwargs. def my_filter(_in, out): assert _in.read() == 'initial value' out.write('filter was here') with TempEnvironmentHelper() as helper: helper.create_files({'in': 'initial value'}) b = helper.mkbundle('in', filters=my_filter, output='out') b.build() assert helper.get('out') == 'filter was here'
def setup(self): try: import cssprefixer except ImportError: raise SkipTest() TempEnvironmentHelper.setup(self)
def setup(self): TempEnvironmentHelper.setup(self) self.env.updater = False self.env.directory = self.path('dir') self.env.debug = True
def setup(self): TempEnvironmentHelper.setup(self) mock_opener = urllib2.build_opener(MockHTTPHandler({ 'http://foo': 'function() {}'})) urllib2.install_opener(mock_opener)
def setup(self): try: import closure_soy except: raise SkipTest() TempEnvironmentHelper.setup(self)
def setup(self): TempEnvironmentHelper.setup(self) mock_opener = urllib2.build_opener( MockHTTPHandler({'http://foo': 'function() {}'})) urllib2.install_opener(mock_opener)
def setup(self): if not find_executable('r.js'): raise SkipTest('"r.js" executable not found') TempEnvironmentHelper.setup(self) self.env.config['requirejs_config'] = self.path('requirejs.json') self.env.config['requirejs_baseUrl'] = self.path('')
def setup(self): TempEnvironmentHelper.setup(self)
def setup(self): if not find_executable('compass'): raise SkipTest() TempEnvironmentHelper.setup(self)
def setup(self): if not find_executable("coffee"): raise SkipTest() TempEnvironmentHelper.setup(self)
def setup(self): if not find_executable("handlebars"): raise SkipTest() TempEnvironmentHelper.setup(self)