Private GIT
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SickRage-1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vlbox
SickRage-1
Commits
98c162d9
Commit
98c162d9
authored
9 years ago
by
labrys
Browse files
Options
Downloads
Patches
Plain Diff
Lint 10/10
parent
b73111ae
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/encoding_tests.py
+23
-10
23 additions, 10 deletions
tests/encoding_tests.py
with
23 additions
and
10 deletions
tests/encoding_tests.py
+
23
−
10
View file @
98c162d9
# coding=utf-8
import
sys
,
os
.
path
"""
Test encoding
"""
sys
.
path
.
insert
(
1
,
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
../lib
'
)))
sys
.
path
.
insert
(
1
,
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
..
'
)))
# pylint: disable=line-too-long
import
sys
import
os.path
import
locale
import
unittest
sys
.
path
.
insert
(
1
,
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
../lib
'
)))
sys
.
path
.
insert
(
1
,
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
..
'
)))
import
sickbeard
from
sickrage.helper.common
import
sanitize_filename
from
sickrage.helper.encoding
import
ek
...
...
@@ -15,8 +21,14 @@ from sickrage.helper.exceptions import ex
class
EncodingTests
(
unittest
.
TestCase
):
"""
Test encodings
"""
def
test_encoding
(
self
):
rootDir
=
'
C:
\\
Temp
\\
TV
'
"""
Test encoding
"""
root_dir
=
'
C:
\\
Temp
\\
TV
'
strings
=
[
u
'
Les Enfants De La T
\xe9
l
\xe9
'
,
u
'
RT� One
'
]
sickbeard
.
SYS_ENCODING
=
None
...
...
@@ -31,17 +43,18 @@ class EncodingTests(unittest.TestCase):
if
not
sickbeard
.
SYS_ENCODING
or
sickbeard
.
SYS_ENCODING
in
(
'
ANSI_X3.4-1968
'
,
'
US-ASCII
'
,
'
ASCII
'
):
sickbeard
.
SYS_ENCODING
=
'
UTF-8
'
for
s
in
strings
:
for
test
in
strings
:
try
:
show_dir
=
ek
(
os
.
path
.
join
,
root
D
ir
,
sanitize_filename
(
s
))
show_dir
=
ek
(
os
.
path
.
join
,
root
_d
ir
,
sanitize_filename
(
test
))
self
.
assertTrue
(
isinstance
(
show_dir
,
unicode
))
except
Exception
,
e
:
ex
(
e
)
except
Exception
as
error
:
# pylint: disable=broad-except
ex
(
e
rror
)
if
__name__
==
"
__main__
"
:
print
"
==================
"
print
"
STARTING - ENCODING TESTS
"
print
"
==================
"
print
"
######################################################################
"
suite
=
unittest
.
TestLoader
().
loadTestsFromTestCase
(
EncodingTests
)
unittest
.
TextTestRunner
(
verbosity
=
2
).
run
(
suite
)
SUITE
=
unittest
.
TestLoader
().
loadTestsFromTestCase
(
EncodingTests
)
unittest
.
TextTestRunner
(
verbosity
=
2
).
run
(
SUITE
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment