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
97407782
Commit
97407782
authored
May 16, 2015
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly handle Python 3.2 where icalendar is not supported.
parent
f7243582
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
test/IcalCommandTest.py
test/IcalCommandTest.py
+14
-1
topydo/lib/IcalCommand.py
topydo/lib/IcalCommand.py
+3
-0
No files found.
test/IcalCommandTest.py
View file @
97407782
...
...
@@ -16,9 +16,9 @@
import
codecs
import
re
import
sys
import
unittest
from
topydo.lib.Config
import
config
from
test.CommandTest
import
CommandTest
from
topydo.lib.IcalCommand
import
IcalCommand
from
test.TestFacilities
import
load_file_to_todolist
...
...
@@ -28,6 +28,7 @@ class IcalCommandTest(CommandTest):
super
(
IcalCommandTest
,
self
).
setUp
()
self
.
todolist
=
load_file_to_todolist
(
"test/data/ListCommandTest.txt"
)
@
unittest
.
skipIf
((
sys
.
version_info
.
major
,
sys
.
version_info
.
minor
)
==
(
3
,
2
),
"icalendar is not supported for Python 3.2"
)
def
test_ical
(
self
):
def
replace_ical_tags
(
p_text
):
# replace identifiers with dots, since they're random.
...
...
@@ -48,6 +49,18 @@ class IcalCommandTest(CommandTest):
self
.
assertEqual
(
replace_ical_tags
(
self
.
output
),
replace_ical_tags
(
icaltext
))
self
.
assertEqual
(
self
.
errors
,
""
)
@
unittest
.
skipUnless
((
sys
.
version_info
.
major
,
sys
.
version_info
.
minor
)
==
(
3
,
2
),
"icalendar is not supported for Python 3.2"
)
def
test_ical_python32
(
self
):
"""
Test case for Python 3.2 where icalendar is not supported.
"""
command
=
IcalCommand
([
""
],
self
.
todolist
,
self
.
out
,
self
.
error
)
command
.
execute
()
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertEqual
(
self
.
output
,
''
)
self
.
assertEqual
(
self
.
errors
,
"icalendar is not supported in this Python version.
\
n
"
)
def
test_help
(
self
):
command
=
IcalCommand
([
"help"
],
self
.
todolist
,
self
.
out
,
self
.
error
)
command
.
execute
()
...
...
topydo/lib/IcalCommand.py
View file @
97407782
...
...
@@ -40,6 +40,9 @@ class IcalCommand(ListCommand):
except
ImportError
:
self
.
error
(
"icalendar package is not installed."
)
return
False
except
SyntaxError
:
self
.
error
(
"icalendar is not supported in this Python version."
)
return
False
return
super
(
IcalCommand
,
self
).
execute
()
...
...
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