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):
30
30
response = requests .post (URL , data ).json ()
31
31
32
32
return response ['compiledCode' ]
33
+
34
+
35
+ def join (text ):
36
+ return text
Original file line number Diff line number Diff line change 4
4
class ClosureAPICompileFilter (CallbackOutputFilter ):
5
5
dependencies = ['requests' ]
6
6
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 15
15
'''
16
16
17
17
18
- class TestCompiler (unittest .TestCase ):
18
+ class TestClosureApiCompiler (unittest .TestCase ):
19
19
20
- def test_minify (self ):
20
+ def test_minify_bad (self ):
21
21
with self .assertRaises (compiler .ParseError ) as cm :
22
22
compiler .minify (ERROR_JS_CODE )
23
23
@@ -28,3 +28,10 @@ def test_minify(self):
28
28
def test_minify_good (self ):
29
29
minify_code = compiler .minify (GOOD_JS_CODE )
30
30
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