Esempio n. 1
0
 def test_input_before_output_nested_merged(self):
     """Same thing as above - a parent input filter is passed done -
     but this time, ensure that duplicate filters are not applied twice.
     """
     child_bundle = Bundle('1', '2', filters=AppendFilter(input='-child'))
     parent_bundle = Bundle(child_bundle, output='out',
                            filters=AppendFilter(input='-parent'))
     parent_bundle.build()
     assert self.get('out') == 'foo-child\nfoo-child'
Esempio n. 2
0
 def test_input_before_output_nested(self):
     """Ensure that when nested bundles are used, a parent bundles
     input filters are applied before a child bundles output filter.
     """
     child_bundle_with_output_filter = Bundle('1', '2',
             filters=ReplaceFilter(output=('foo', 'output was here')))
     parent_bundle_with_input_filter = Bundle(child_bundle_with_output_filter,
             output='out',
             filters=ReplaceFilter(input=('foo', 'input was here')))
     parent_bundle_with_input_filter.build()
     assert self.get('out') == 'input was here\ninput was here'
Esempio n. 3
0
    def test_cache_enabled(self):
	bundle = Bundle('in1', 'in2', output='out', filters="jsmin")
	self.cache.enabled = True
	bundle.build()
	assert_equals(self.cache.getops, 3)
	assert_equals(self.cache.setops, 0)