File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed
django_compressor_closure_api_compile_filter Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -30,3 +30,7 @@ def minify(text):
3030 response = requests .post (URL , data ).json ()
3131
3232 return response ['compiledCode' ]
33+
34+
35+ def join (text ):
36+ return text
Original file line number Diff line number Diff line change 44class ClosureAPICompileFilter (CallbackOutputFilter ):
55 dependencies = ['requests' ]
66 callback = 'django_compressor_closure_api_compile_filter.compiler.minify'
7+
8+
9+ class JoinAPICompileFilter (CallbackOutputFilter ):
10+ callback = 'django_compressor_closure_api_compile_filter.compiler.join'
Original file line number Diff line number Diff line change 1515'''
1616
1717
18- class TestCompiler (unittest .TestCase ):
18+ class TestClosureApiCompiler (unittest .TestCase ):
1919
20- def test_minify (self ):
20+ def test_minify_bad (self ):
2121 with self .assertRaises (compiler .ParseError ) as cm :
2222 compiler .minify (ERROR_JS_CODE )
2323
@@ -28,3 +28,10 @@ def test_minify(self):
2828 def test_minify_good (self ):
2929 minify_code = compiler .minify (GOOD_JS_CODE )
3030 self .assertTrue (minify_code , 'function hello(){console.log()};' )
31+
32+
33+ class TestJoinApiCompiler (unittest .TestCase ):
34+
35+ def test_join (self ):
36+ code = compiler .join (GOOD_JS_CODE )
37+ self .assertTrue (code , GOOD_JS_CODE )
You can’t perform that action at this time.
0 commit comments