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
c2037fc8
Commit
c2037fc8
authored
Sep 27, 2014
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add method to mark a list as completed from TodoList.
This will mark the todo list dirty.
parent
42dba297
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
TodoList.py
TodoList.py
+5
-0
test/TodoListTest.py
test/TodoListTest.py
+4
-0
No files found.
TodoList.py
View file @
c2037fc8
...
...
@@ -280,6 +280,11 @@ class TodoList(object):
def todos(self):
return self._todos
def set_todo_completed(self, p_number):
todo = self.todo(p_number)
todo.set_completed()
self.dirty = True
def __str__(self):
return '
\
n
'.join(pretty_print(self._todos))
test/TodoListTest.py
View file @
c2037fc8
...
...
@@ -142,6 +142,10 @@ class TodoListTester(unittest.TestCase):
self
.
assertIsInstance
(
todo
,
Todo
.
Todo
)
self
.
assertEquals
(
todo
.
text
(),
"No number"
)
def
test_todo_complete
(
self
):
self
.
todolist
.
set_todo_completed
(
1
)
self
.
assertTrue
(
self
.
todolist
.
todo
(
1
).
is_completed
())
class
TodoListDependencyTester
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
todolist
=
TodoList
.
TodoList
([])
...
...
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