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
b0667a0e
Commit
b0667a0e
authored
May 16, 2015
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ical subcommand (correctly) reports error instead of help, reflect in test.
parent
97407782
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
test/IcalCommandTest.py
test/IcalCommandTest.py
+13
-2
No files found.
test/IcalCommandTest.py
View file @
b0667a0e
...
...
@@ -23,12 +23,14 @@ from test.CommandTest import CommandTest
from
topydo.lib.IcalCommand
import
IcalCommand
from
test.TestFacilities
import
load_file_to_todolist
IS_PYTHON_32
=
(
sys
.
version_info
.
major
,
sys
.
version_info
.
minor
)
==
(
3
,
2
)
class
IcalCommandTest
(
CommandTest
):
def
setUp
(
self
):
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"
)
@
unittest
.
skipIf
(
IS_PYTHON_32
,
"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.
...
...
@@ -49,7 +51,7 @@ 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"
)
@
unittest
.
skipUnless
(
IS_PYTHON_32
,
"icalendar is not supported for Python 3.2"
)
def
test_ical_python32
(
self
):
"""
Test case for Python 3.2 where icalendar is not supported.
...
...
@@ -61,6 +63,7 @@ class IcalCommandTest(CommandTest):
self
.
assertEqual
(
self
.
output
,
''
)
self
.
assertEqual
(
self
.
errors
,
"icalendar is not supported in this Python version.
\
n
"
)
@
unittest
.
skipIf
(
IS_PYTHON_32
,
"icalendar is not supported for Python 3.2"
)
def
test_help
(
self
):
command
=
IcalCommand
([
"help"
],
self
.
todolist
,
self
.
out
,
self
.
error
)
command
.
execute
()
...
...
@@ -68,5 +71,13 @@ class IcalCommandTest(CommandTest):
self
.
assertEqual
(
self
.
output
,
""
)
self
.
assertEqual
(
self
.
errors
,
command
.
usage
()
+
"
\
n
\
n
"
+
command
.
help
()
+
"
\
n
"
)
@
unittest
.
skipUnless
(
IS_PYTHON_32
,
"icalendar is not supported for Python 3.2"
)
def
test_help_python32
(
self
):
command
=
IcalCommand
([
"help"
],
self
.
todolist
,
self
.
out
,
self
.
error
)
command
.
execute
()
self
.
assertEqual
(
self
.
output
,
""
)
self
.
assertEqual
(
self
.
errors
,
"icalendar is not supported in this Python version.
\
n
"
)
if
__name__
==
'__main__'
:
unittest
.
main
()
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