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
c547b850
Commit
c547b850
authored
Jun 06, 2015
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve coverage of JsonPrinter by printing a single todo item.
parent
ead9c3b3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletion
+33
-1
test/JsonPrinterTest.py
test/JsonPrinterTest.py
+33
-0
test/ListCommandTest.py
test/ListCommandTest.py
+0
-1
No files found.
test/JsonPrinterTest.py
0 → 100644
View file @
c547b850
# Topydo - A todo.txt client written in Python.
# Copyright (C) 2015 Bram Schoenmakers <me@bramschoenmakers.nl>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from
topydo.lib.JsonPrinter
import
JsonPrinter
from
topydo.lib.Todo
import
Todo
from
test.TopydoTest
import
TopydoTest
class
JsonPrinterTest
(
TopydoTest
):
"""
Tests the functionality of printing a single todo item. Printing a list is
already covered by the ListCommand tests.
"""
def
test_json
(
self
):
""" Print a single todo item. """
printer
=
JsonPrinter
()
todo
=
Todo
(
'2015-06-06 Foo due:2015-05-32'
)
result
=
printer
.
print_todo
(
todo
)
self
.
assertEqual
(
result
,
'{"completed": false, "completion_date": null, "contexts": [], "creation_date": "2015-06-06", "priority": null, "projects": [], "source": "2015-06-06 Foo due:2015-05-32", "tags": [["due", "2015-05-32"]], "text": "Foo"}'
)
test/ListCommandTest.py
View file @
c547b850
...
...
@@ -224,7 +224,6 @@ class ListCommandUnicodeTest(CommandTest):
self
.
assertEqual
(
self
.
output
,
expected
)
class
ListCommandJsonTest
(
CommandTest
):
def
test_json
(
self
):
todolist
=
load_file_to_todolist
(
"test/data/ListCommandTest.txt"
)
...
...
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