Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-pipeline
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
django-pipeline
Commits
194004f5
Commit
194004f5
authored
Aug 29, 2013
by
Caio Ariede
Committed by
Timothée Peignier
Aug 29, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes a bug when the file contains unicode data. #242
parent
6caa32c4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
2 deletions
+19
-2
pipeline/compressors/__init__.py
+1
-1
tests/assets/css/unicode.css
+4
-0
tests/tests/test_compressor.py
+14
-1
No files found.
pipeline/compressors/__init__.py
View file @
194004f5
...
...
@@ -236,4 +236,4 @@ class SubProcessCompressor(CompressorBase):
raise
CompressorError
(
stderr
)
if
self
.
verbose
:
print
(
stderr
)
return
stdout
return
force_text
(
stdout
)
tests/assets/css/unicode.css
0 → 100644
View file @
194004f5
.some_class
{
//
Some
unicode
content
:
"áéíóú"
;
}
tests/tests/test_compressor.py
View file @
194004f5
...
...
@@ -2,6 +2,7 @@
from
__future__
import
unicode_literals
import
base64
import
os
try
:
from
mock
import
patch
...
...
@@ -10,7 +11,8 @@ except ImportError:
from
django.test
import
TestCase
from
pipeline.compressors
import
Compressor
,
TEMPLATE_FUNC
from
pipeline.compressors
import
Compressor
,
TEMPLATE_FUNC
,
\
SubProcessCompressor
from
pipeline.compressors.yuglify
import
YuglifyCompressor
from
tests.utils
import
_
...
...
@@ -127,3 +129,14 @@ class CompressorTest(TestCase):
.no-protocol-url {
background-image: url(//images/sprite-buttons.png);
}"""
,
output
)
def
test_compressor_subprocess_unicode
(
self
):
tests_path
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
__file__
))
output
=
SubProcessCompressor
(
False
)
.
execute_command
(
'/usr/bin/env cat'
,
open
(
tests_path
+
'/assets/css/unicode.css'
)
.
read
())
self
.
assertEqual
(
""".some_class {
// Some unicode
content: "áéíóú";
}
"""
,
output
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment