Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
topydo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
topydo
Commits
14ecbac7
Commit
14ecbac7
authored
May 30, 2015
by
Jacek Sowiński
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test printing ics (ical) output with unicode chars.
parent
4a7e8aed
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
test/IcalCommandTest.py
test/IcalCommandTest.py
+27
-1
test/data/ListCommandUnicodeTest.ics
test/data/ListCommandUnicodeTest.ics
+0
-0
No files found.
test/IcalCommandTest.py
View file @
14ecbac7
...
@@ -21,7 +21,7 @@ import unittest
...
@@ -21,7 +21,7 @@ import unittest
from
topydo.lib.Config
import
config
from
topydo.lib.Config
import
config
from
topydo.commands.IcalCommand
import
IcalCommand
from
topydo.commands.IcalCommand
import
IcalCommand
from
test.CommandTest
import
CommandTest
from
test.CommandTest
import
CommandTest
,
utf8
from
test.TestFacilities
import
load_file_to_todolist
from
test.TestFacilities
import
load_file_to_todolist
IS_PYTHON_32
=
(
sys
.
version_info
.
major
,
sys
.
version_info
.
minor
)
==
(
3
,
2
)
IS_PYTHON_32
=
(
sys
.
version_info
.
major
,
sys
.
version_info
.
minor
)
==
(
3
,
2
)
...
@@ -80,5 +80,31 @@ class IcalCommandTest(CommandTest):
...
@@ -80,5 +80,31 @@ class IcalCommandTest(CommandTest):
self
.
assertEqual
(
self
.
output
,
""
)
self
.
assertEqual
(
self
.
output
,
""
)
self
.
assertEqual
(
self
.
errors
,
"icalendar is not supported in this Python version.
\
n
"
)
self
.
assertEqual
(
self
.
errors
,
"icalendar is not supported in this Python version.
\
n
"
)
class
IcalCommandUnicodeTest
(
CommandTest
):
def
setUp
(
self
):
super
(
IcalCommandUnicodeTest
,
self
).
setUp
()
self
.
todolist
=
load_file_to_todolist
(
"test/data/ListCommandUnicodeTest.txt"
)
@
unittest
.
skipIf
(
IS_PYTHON_32
,
"icalendar is not supported for Python 3.2"
)
def
test_ical_unicode
(
self
):
def
replace_ical_tags
(
p_text
):
# replace identifiers with dots, since they're random.
result
=
re
.
sub
(
r'\bical:....\b'
,
'ical:....'
,
p_text
)
result
=
re
.
sub
(
r'\bUID:....\b'
,
'UID:....'
,
result
)
return
result
command
=
IcalCommand
([
""
],
self
.
todolist
,
self
.
out
,
self
.
error
)
command
.
execute
()
# self.assertTrue(self.todolist.is_dirty())
icaltext
=
""
with
codecs
.
open
(
'test/data/ListCommandUnicodeTest.ics'
,
'r'
,
encoding
=
'utf-8'
)
as
ical
:
icaltext
=
ical
.
read
()
self
.
assertEqual
(
replace_ical_tags
(
self
.
output
),
utf8
(
replace_ical_tags
(
icaltext
)))
self
.
assertEqual
(
self
.
errors
,
""
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
.
main
()
test/data/ListCommandUnicodeTest.ics
0 → 100644
View file @
14ecbac7
This diff was suppressed by a .gitattributes entry.
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