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
64f1ad6a
Commit
64f1ad6a
authored
Mar 26, 2015
by
Jacek Sowiński
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests for 'del' and 'do'
Adjust to changes introduced in: 3f096
parent
3f09644c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
10 deletions
+18
-10
test/DeleteCommandTest.py
test/DeleteCommandTest.py
+13
-2
test/DoCommandTest.py
test/DoCommandTest.py
+5
-8
No files found.
test/DeleteCommandTest.py
View file @
64f1ad6a
...
...
@@ -133,11 +133,22 @@ class DeleteCommandTest(CommandTest.CommandTest):
self
.
assertEquals
(
self
.
todolist
.
count
(),
0
)
def
test_multi_del3
(
self
):
"""
Test deletion of multiple items
. """
"""
Fail if any of supplied todo numbers is invalid
. """
command
=
DeleteCommand
([
"99"
,
"2"
],
self
.
todolist
,
self
.
out
,
self
.
error
,
_yes_prompt
)
command
.
execute
()
self
.
assertEquals
(
self
.
todolist
.
count
(),
1
)
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertEquals
(
self
.
output
,
""
)
self
.
assertEquals
(
self
.
errors
,
"Invalid todo number given: 99.
\
n
"
)
def
test_multi_del4
(
self
):
""" Check output when all supplied todo numbers are invalid. """
command
=
DeleteCommand
([
"99"
,
"A"
],
self
.
todolist
,
self
.
out
,
self
.
error
,
_yes_prompt
)
command
.
execute
()
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertEquals
(
self
.
output
,
""
)
self
.
assertEquals
(
self
.
errors
,
"Invalid todo number given: 99.
\
n
Invalid todo number given: A.
\
n
"
)
def
test_empty
(
self
):
command
=
DeleteCommand
([],
self
.
todolist
,
self
.
out
,
self
.
error
)
...
...
test/DoCommandTest.py
View file @
64f1ad6a
...
...
@@ -312,20 +312,17 @@ class DoCommandTest(CommandTest.CommandTest):
command
=
DoCommand
([
"99"
,
"3"
],
self
.
todolist
,
self
.
out
,
self
.
error
,
_no_prompt
)
command
.
execute
()
self
.
assertTrue
(
self
.
todolist
.
todo
(
3
).
is_completed
())
self
.
assertEquals
(
self
.
output
,
"Completed: x {} Baz p:1
\
n
"
.
format
(
self
.
today
))
self
.
assertEquals
(
self
.
errors
,
"Invalid todo number given.
\
n
"
)
self
.
assertFalse
(
self
.
todolist
.
todo
(
3
).
is_completed
())
self
.
assertEquals
(
self
.
errors
,
"Invalid todo number given: 99.
\
n
"
)
def
test_multi_do5
(
self
):
"""
When a todo item was generated by a recurring todo item, make sure
it cannot be completed in the same invocation.
Check output when all supplied todo numbers are invalid.
"""
command
=
DoCommand
([
"
4
"
,
"10"
],
self
.
todolist
,
self
.
out
,
self
.
error
,
_no_prompt
)
command
=
DoCommand
([
"
99
"
,
"10"
],
self
.
todolist
,
self
.
out
,
self
.
error
,
_no_prompt
)
command
.
execute
()
self
.
assertTrue
(
self
.
todolist
.
todo
(
4
).
is_completed
())
self
.
assertFalse
(
self
.
todolist
.
todo
(
10
).
is_completed
())
self
.
assertEquals
(
self
.
errors
,
"Invalid todo number given: 99.
\
n
Invalid todo number given: 10.
\
n
"
)
def
test_invalid_recurrence
(
self
):
""" Show error message when an item has an invalid recurrence pattern. """
...
...
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