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
b26c9b1f
Commit
b26c9b1f
authored
May 05, 2015
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix EditCommandTest after moving commands to separate package.
parent
d20df450
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
test/EditCommandTest.py
test/EditCommandTest.py
+8
-8
No files found.
test/EditCommandTest.py
View file @
b26c9b1f
...
...
@@ -18,7 +18,7 @@ import unittest
import
mock
import
CommandTest
from
topydo.
lib
.EditCommand
import
EditCommand
from
topydo.
commands
.EditCommand
import
EditCommand
from
topydo.lib.TodoList
import
TodoList
from
topydo.lib.Todo
import
Todo
...
...
@@ -34,7 +34,7 @@ class EditCommandTest(CommandTest.CommandTest):
self
.
todolist
=
TodoList
(
todos
)
@
mock
.
patch
(
'topydo.
lib
.EditCommand.EditCommand._open_in_editor'
)
@
mock
.
patch
(
'topydo.
commands
.EditCommand.EditCommand._open_in_editor'
)
def
test_edit1
(
self
,
mock_open_in_editor
):
""" Preserve dependencies after editing. """
mock_open_in_editor
.
return_value
=
0
...
...
@@ -46,8 +46,8 @@ class EditCommandTest(CommandTest.CommandTest):
self
.
assertEquals
(
self
.
errors
,
""
)
self
.
assertEquals
(
str
(
self
.
todolist
),
"Bar p:1 @test
\
n
Baz @test
\
n
Foo id:1"
)
@
mock
.
patch
(
'topydo.
lib
.EditCommand.EditCommand._todos_from_temp'
)
@
mock
.
patch
(
'topydo.
lib
.EditCommand.EditCommand._open_in_editor'
)
@
mock
.
patch
(
'topydo.
commands
.EditCommand.EditCommand._todos_from_temp'
)
@
mock
.
patch
(
'topydo.
commands
.EditCommand.EditCommand._open_in_editor'
)
def
test_edit2
(
self
,
mock_open_in_editor
,
mock_todos_from_temp
):
""" Edit some todo. """
mock_open_in_editor
.
return_value
=
0
...
...
@@ -76,8 +76,8 @@ class EditCommandTest(CommandTest.CommandTest):
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertEquals
(
self
.
errors
,
"Invalid todo number given: 4.
\
n
"
)
@
mock
.
patch
(
'topydo.
lib
.EditCommand.EditCommand._todos_from_temp'
)
@
mock
.
patch
(
'topydo.
lib
.EditCommand.EditCommand._open_in_editor'
)
@
mock
.
patch
(
'topydo.
commands
.EditCommand.EditCommand._todos_from_temp'
)
@
mock
.
patch
(
'topydo.
commands
.EditCommand.EditCommand._open_in_editor'
)
def
test_edit5
(
self
,
mock_open_in_editor
,
mock_todos_from_temp
):
""" Don't let to delete todos acidentally while editing. """
mock_open_in_editor
.
return_value
=
0
...
...
@@ -90,8 +90,8 @@ class EditCommandTest(CommandTest.CommandTest):
self
.
assertEquals
(
self
.
errors
,
"Number of edited todos is not equal to number of supplied todo IDs.
\
n
"
)
self
.
assertEquals
(
str
(
self
.
todolist
),
"Foo id:1
\
n
Bar p:1 @test
\
n
Baz @test"
)
@
mock
.
patch
(
'topydo.
lib
.EditCommand.EditCommand._todos_from_temp'
)
@
mock
.
patch
(
'topydo.
lib
.EditCommand.EditCommand._open_in_editor'
)
@
mock
.
patch
(
'topydo.
commands
.EditCommand.EditCommand._todos_from_temp'
)
@
mock
.
patch
(
'topydo.
commands
.EditCommand.EditCommand._open_in_editor'
)
def
test_edit_expr
(
self
,
mock_open_in_editor
,
mock_todos_from_temp
):
""" Edit todos matching expression. """
mock_open_in_editor
.
return_value
=
0
...
...
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