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
94e19f43
Commit
94e19f43
authored
Nov 05, 2015
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a creation date to an entry to test whether it's printed.
This should have caught the bug that was fixed in
a92411f7
.
parent
a92411f7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
17 deletions
+17
-17
test/data/ListCommandTest.json
test/data/ListCommandTest.json
+1
-1
test/data/ListCommandTest.txt
test/data/ListCommandTest.txt
+1
-1
test/test_list_command.py
test/test_list_command.py
+15
-15
No files found.
test/data/ListCommandTest.json
View file @
94e19f43
[{
"completed"
:
false
,
"completion_date"
:
null
,
"contexts"
:
[
"Context2"
],
"creation_date"
:
null
,
"priority"
:
"C"
,
"projects"
:
[
"Project1"
],
"source"
:
"(C) Foo @Context2 Not@Context +Project1 Not+Project"
,
"tags"
:
[],
"text"
:
"Foo @Context2 Not@Context +Project1 Not+Project"
},
{
"completed"
:
false
,
"completion_date"
:
null
,
"contexts"
:
[],
"creation_date"
:
null
,
"priority"
:
"C"
,
"projects"
:
[],
"source"
:
"(C) Drink beer @ home"
,
"tags"
:
[],
"text"
:
"Drink beer @ home"
},
{
"completed"
:
false
,
"completion_date"
:
null
,
"contexts"
:
[],
"creation_date"
:
null
,
"priority"
:
"C"
,
"projects"
:
[],
"source"
:
"(C) 13 + 29 = 42"
,
"tags"
:
[],
"text"
:
"13 + 29 = 42"
},
{
"completed"
:
false
,
"completion_date"
:
null
,
"contexts"
:
[
"Context1"
],
"creation_date"
:
null
,
"priority"
:
"D"
,
"projects"
:
[
"Project2"
],
"source"
:
"(D) Bar @Context1 +Project2 p:1"
,
"tags"
:
[[
"p"
,
"1"
]],
"text"
:
"Bar @Context1 +Project2"
}]
[{
"completed"
:
false
,
"completion_date"
:
null
,
"contexts"
:
[
"Context2"
],
"creation_date"
:
null
,
"priority"
:
"C"
,
"projects"
:
[
"Project1"
],
"source"
:
"(C)
2015-11-05
Foo @Context2 Not@Context +Project1 Not+Project"
,
"tags"
:
[],
"text"
:
"Foo @Context2 Not@Context +Project1 Not+Project"
},
{
"completed"
:
false
,
"completion_date"
:
null
,
"contexts"
:
[],
"creation_date"
:
null
,
"priority"
:
"C"
,
"projects"
:
[],
"source"
:
"(C) Drink beer @ home"
,
"tags"
:
[],
"text"
:
"Drink beer @ home"
},
{
"completed"
:
false
,
"completion_date"
:
null
,
"contexts"
:
[],
"creation_date"
:
null
,
"priority"
:
"C"
,
"projects"
:
[],
"source"
:
"(C) 13 + 29 = 42"
,
"tags"
:
[],
"text"
:
"13 + 29 = 42"
},
{
"completed"
:
false
,
"completion_date"
:
null
,
"contexts"
:
[
"Context1"
],
"creation_date"
:
null
,
"priority"
:
"D"
,
"projects"
:
[
"Project2"
],
"source"
:
"(D) Bar @Context1 +Project2 p:1"
,
"tags"
:
[[
"p"
,
"1"
]],
"text"
:
"Bar @Context1 +Project2"
}]
test/data/ListCommandTest.txt
View file @
94e19f43
(C) Foo @Context2 Not@Context +Project1 Not+Project
(C)
2015-11-05
Foo @Context2 Not@Context +Project1 Not+Project
(D) Bar @Context1 +Project2 p:1
(D) Bar @Context1 +Project2 p:1
(C) Baz @Context1 +Project1 key:value id:1
(C) Baz @Context1 +Project1 key:value id:1
(C) Drink beer @ home
(C) Drink beer @ home
...
...
test/test_list_command.py
View file @
94e19f43
...
@@ -36,7 +36,7 @@ class ListCommandTest(CommandTest):
...
@@ -36,7 +36,7 @@ class ListCommandTest(CommandTest):
command
.
execute
()
command
.
execute
()
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertEqual
(
self
.
output
,
"| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project
\
n
| 4| (C) Drink beer @ home
\
n
| 5| (C) 13 + 29 = 42
\
n
| 2| (D) Bar @Context1 +Project2
\
n
"
)
self
.
assertEqual
(
self
.
output
,
"| 1| (C)
2015-11-05
Foo @Context2 Not@Context +Project1 Not+Project
\
n
| 4| (C) Drink beer @ home
\
n
| 5| (C) 13 + 29 = 42
\
n
| 2| (D) Bar @Context1 +Project2
\
n
"
)
self
.
assertEqual
(
self
.
errors
,
""
)
self
.
assertEqual
(
self
.
errors
,
""
)
def
test_list03
(
self
):
def
test_list03
(
self
):
...
@@ -62,7 +62,7 @@ class ListCommandTest(CommandTest):
...
@@ -62,7 +62,7 @@ class ListCommandTest(CommandTest):
command
.
execute
()
command
.
execute
()
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertEqual
(
self
.
output
,
"| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project
\
n
| 3| (C) Baz @Context1 +Project1 key:value
\
n
| 4| (C) Drink beer @ home
\
n
| 5| (C) 13 + 29 = 42
\
n
| 2| (D) Bar @Context1 +Project2
\
n
| 6| x 2014-12-12 Completed but with date:2014-12-12
\
n
"
)
self
.
assertEqual
(
self
.
output
,
"| 1| (C)
2015-11-05
Foo @Context2 Not@Context +Project1 Not+Project
\
n
| 3| (C) Baz @Context1 +Project1 key:value
\
n
| 4| (C) Drink beer @ home
\
n
| 5| (C) 13 + 29 = 42
\
n
| 2| (D) Bar @Context1 +Project2
\
n
| 6| x 2014-12-12 Completed but with date:2014-12-12
\
n
"
)
self
.
assertEqual
(
self
.
errors
,
""
)
self
.
assertEqual
(
self
.
errors
,
""
)
def
test_list06
(
self
):
def
test_list06
(
self
):
...
@@ -80,7 +80,7 @@ class ListCommandTest(CommandTest):
...
@@ -80,7 +80,7 @@ class ListCommandTest(CommandTest):
command
.
execute
()
command
.
execute
()
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertEqual
(
self
.
output
,
"| 3| (C) Baz @Context1 +Project1 key:value
\
n
| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project
\
n
"
)
self
.
assertEqual
(
self
.
output
,
"| 3| (C) Baz @Context1 +Project1 key:value
\
n
| 1| (C)
2015-11-05
Foo @Context2 Not@Context +Project1 Not+Project
\
n
"
)
self
.
assertEqual
(
self
.
errors
,
""
)
self
.
assertEqual
(
self
.
errors
,
""
)
def
test_list08
(
self
):
def
test_list08
(
self
):
...
@@ -117,7 +117,7 @@ class ListCommandTest(CommandTest):
...
@@ -117,7 +117,7 @@ class ListCommandTest(CommandTest):
command
.
execute
()
command
.
execute
()
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertEqual
(
self
.
output
,
"| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project
\
n
"
)
self
.
assertEqual
(
self
.
output
,
"| 1| (C)
2015-11-05
Foo @Context2 Not@Context +Project1 Not+Project
\
n
"
)
self
.
assertEqual
(
self
.
errors
,
""
)
self
.
assertEqual
(
self
.
errors
,
""
)
def
test_list12
(
self
):
def
test_list12
(
self
):
...
@@ -128,7 +128,7 @@ class ListCommandTest(CommandTest):
...
@@ -128,7 +128,7 @@ class ListCommandTest(CommandTest):
command
.
execute
()
command
.
execute
()
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertEqual
(
self
.
output
,
"| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project
\
n
| 3| (C) Baz @Context1 +Project1 key:value
\
n
| 2| (D) Bar @Context1 +Project2
\
n
"
)
self
.
assertEqual
(
self
.
output
,
"| 1| (C)
2015-11-05
Foo @Context2 Not@Context +Project1 Not+Project
\
n
| 3| (C) Baz @Context1 +Project1 key:value
\
n
| 2| (D) Bar @Context1 +Project2
\
n
"
)
self
.
assertEqual
(
self
.
errors
,
""
)
self
.
assertEqual
(
self
.
errors
,
""
)
def
test_list13
(
self
):
def
test_list13
(
self
):
...
@@ -137,7 +137,7 @@ class ListCommandTest(CommandTest):
...
@@ -137,7 +137,7 @@ class ListCommandTest(CommandTest):
command
.
execute
()
command
.
execute
()
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertEqual
(
self
.
output
,
"| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project
\
n
| 3| (C) Baz @Context1 +Project1 key:value
\
n
| 4| (C) Drink beer @ home
\
n
| 5| (C) 13 + 29 = 42
\
n
| 6| x 2014-12-12 Completed but with date:2014-12-12
\
n
"
)
self
.
assertEqual
(
self
.
output
,
"| 1| (C)
2015-11-05
Foo @Context2 Not@Context +Project1 Not+Project
\
n
| 3| (C) Baz @Context1 +Project1 key:value
\
n
| 4| (C) Drink beer @ home
\
n
| 5| (C) 13 + 29 = 42
\
n
| 6| x 2014-12-12 Completed but with date:2014-12-12
\
n
"
)
self
.
assertEqual
(
self
.
errors
,
""
)
self
.
assertEqual
(
self
.
errors
,
""
)
def
test_list14
(
self
):
def
test_list14
(
self
):
...
@@ -147,7 +147,7 @@ class ListCommandTest(CommandTest):
...
@@ -147,7 +147,7 @@ class ListCommandTest(CommandTest):
command
.
execute
()
command
.
execute
()
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertEqual
(
self
.
output
,
" | 1| (C) Foo @Context2 Not@Context +Project1 Not+Project
\
n
| 4| (C) Drink beer @ home
\
n
| 5| (C) 13 + 29 = 42
\
n
| 2| (D) Bar @Context1 +Project2
\
n
"
)
self
.
assertEqual
(
self
.
output
,
" | 1| (C)
2015-11-05
Foo @Context2 Not@Context +Project1 Not+Project
\
n
| 4| (C) Drink beer @ home
\
n
| 5| (C) 13 + 29 = 42
\
n
| 2| (D) Bar @Context1 +Project2
\
n
"
)
self
.
assertEqual
(
self
.
errors
,
""
)
self
.
assertEqual
(
self
.
errors
,
""
)
def
test_list15
(
self
):
def
test_list15
(
self
):
...
@@ -165,7 +165,7 @@ class ListCommandTest(CommandTest):
...
@@ -165,7 +165,7 @@ class ListCommandTest(CommandTest):
command
.
execute
()
command
.
execute
()
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertEqual
(
self
.
output
,
"|t5c| (C) Foo @Context2 Not@Context +Project1 Not+Project
\
n
|wa5| (C) Drink beer @ home
\
n
|z63| (C) 13 + 29 = 42
\
n
|mfg| (D) Bar @Context1 +Project2
\
n
"
)
self
.
assertEqual
(
self
.
output
,
"|t5c| (C)
2015-11-05
Foo @Context2 Not@Context +Project1 Not+Project
\
n
|wa5| (C) Drink beer @ home
\
n
|z63| (C) 13 + 29 = 42
\
n
|mfg| (D) Bar @Context1 +Project2
\
n
"
)
self
.
assertEqual
(
self
.
errors
,
""
)
self
.
assertEqual
(
self
.
errors
,
""
)
def
test_list17
(
self
):
def
test_list17
(
self
):
...
@@ -195,7 +195,7 @@ class ListCommandTest(CommandTest):
...
@@ -195,7 +195,7 @@ class ListCommandTest(CommandTest):
command
.
execute
()
command
.
execute
()
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertEqual
(
self
.
output
,
"| 3| (C) Baz @Context1 +Project1 id:1 key:value
\
n
| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project
\
n
"
)
self
.
assertEqual
(
self
.
output
,
"| 3| (C) Baz @Context1 +Project1 id:1 key:value
\
n
| 1| (C)
2015-11-05
Foo @Context2 Not@Context +Project1 Not+Project
\
n
"
)
self
.
assertEqual
(
self
.
errors
,
""
)
self
.
assertEqual
(
self
.
errors
,
""
)
def
test_list20
(
self
):
def
test_list20
(
self
):
...
@@ -203,7 +203,7 @@ class ListCommandTest(CommandTest):
...
@@ -203,7 +203,7 @@ class ListCommandTest(CommandTest):
command
.
execute
()
command
.
execute
()
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertEqual
(
self
.
output
,
"| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project
\
n
| 4| (C) Drink beer @ home
\
n
| 5| (C) 13 + 29 = 42
\
n
| 2| (D) Bar @Context1 +Project2
\
n
"
)
self
.
assertEqual
(
self
.
output
,
"| 1| (C)
2015-11-05
Foo @Context2 Not@Context +Project1 Not+Project
\
n
| 4| (C) Drink beer @ home
\
n
| 5| (C) 13 + 29 = 42
\
n
| 2| (D) Bar @Context1 +Project2
\
n
"
)
self
.
assertEqual
(
self
.
errors
,
""
)
self
.
assertEqual
(
self
.
errors
,
""
)
def
test_list21
(
self
):
def
test_list21
(
self
):
...
@@ -212,7 +212,7 @@ class ListCommandTest(CommandTest):
...
@@ -212,7 +212,7 @@ class ListCommandTest(CommandTest):
command
.
execute
()
command
.
execute
()
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertEqual
(
self
.
output
,
"| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project
\
n
| 4| (C) Drink beer @ home
\
n
| 5| (C) 13 + 29 = 42
\
n
| 2| (D) Bar @Context1 +Project2
\
n
"
)
self
.
assertEqual
(
self
.
output
,
"| 1| (C)
2015-11-05
Foo @Context2 Not@Context +Project1 Not+Project
\
n
| 4| (C) Drink beer @ home
\
n
| 5| (C) 13 + 29 = 42
\
n
| 2| (D) Bar @Context1 +Project2
\
n
"
)
self
.
assertEqual
(
self
.
errors
,
""
)
self
.
assertEqual
(
self
.
errors
,
""
)
def
test_list22
(
self
):
def
test_list22
(
self
):
...
@@ -239,7 +239,7 @@ class ListCommandTest(CommandTest):
...
@@ -239,7 +239,7 @@ class ListCommandTest(CommandTest):
command
=
ListCommand
([
"-n"
,
"1"
],
self
.
todolist
,
self
.
out
,
self
.
error
)
command
=
ListCommand
([
"-n"
,
"1"
],
self
.
todolist
,
self
.
out
,
self
.
error
)
command
.
execute
()
command
.
execute
()
self
.
assertEqual
(
self
.
output
,
"| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project
\
n
"
)
self
.
assertEqual
(
self
.
output
,
"| 1| (C)
2015-11-05
Foo @Context2 Not@Context +Project1 Not+Project
\
n
"
)
self
.
assertEqual
(
self
.
errors
,
""
)
self
.
assertEqual
(
self
.
errors
,
""
)
def
test_list33
(
self
):
def
test_list33
(
self
):
...
@@ -247,7 +247,7 @@ class ListCommandTest(CommandTest):
...
@@ -247,7 +247,7 @@ class ListCommandTest(CommandTest):
command
=
ListCommand
([
"-n"
,
"-1"
],
self
.
todolist
,
self
.
out
,
self
.
error
)
command
=
ListCommand
([
"-n"
,
"-1"
],
self
.
todolist
,
self
.
out
,
self
.
error
)
command
.
execute
()
command
.
execute
()
self
.
assertEqual
(
self
.
output
,
"| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project
\
n
| 4| (C) Drink beer @ home
\
n
| 5| (C) 13 + 29 = 42
\
n
| 2| (D) Bar @Context1 +Project2
\
n
"
)
self
.
assertEqual
(
self
.
output
,
"| 1| (C)
2015-11-05
Foo @Context2 Not@Context +Project1 Not+Project
\
n
| 4| (C) Drink beer @ home
\
n
| 5| (C) 13 + 29 = 42
\
n
| 2| (D) Bar @Context1 +Project2
\
n
"
)
self
.
assertEqual
(
self
.
errors
,
""
)
self
.
assertEqual
(
self
.
errors
,
""
)
def
test_list34
(
self
):
def
test_list34
(
self
):
...
@@ -257,7 +257,7 @@ class ListCommandTest(CommandTest):
...
@@ -257,7 +257,7 @@ class ListCommandTest(CommandTest):
command
=
ListCommand
([
"-n"
,
"foo"
],
self
.
todolist
,
self
.
out
,
self
.
error
)
command
=
ListCommand
([
"-n"
,
"foo"
],
self
.
todolist
,
self
.
out
,
self
.
error
)
command
.
execute
()
command
.
execute
()
self
.
assertEqual
(
self
.
output
,
"| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project
\
n
| 4| (C) Drink beer @ home
\
n
"
)
self
.
assertEqual
(
self
.
output
,
"| 1| (C)
2015-11-05
Foo @Context2 Not@Context +Project1 Not+Project
\
n
| 4| (C) Drink beer @ home
\
n
"
)
self
.
assertEqual
(
self
.
errors
,
""
)
self
.
assertEqual
(
self
.
errors
,
""
)
def
test_list35
(
self
):
def
test_list35
(
self
):
...
@@ -265,7 +265,7 @@ class ListCommandTest(CommandTest):
...
@@ -265,7 +265,7 @@ class ListCommandTest(CommandTest):
command
=
ListCommand
([
"-x"
,
"-n"
,
"foo"
],
self
.
todolist
,
self
.
out
,
self
.
error
)
command
=
ListCommand
([
"-x"
,
"-n"
,
"foo"
],
self
.
todolist
,
self
.
out
,
self
.
error
)
command
.
execute
()
command
.
execute
()
self
.
assertEqual
(
self
.
output
,
"| 1| (C) Foo @Context2 Not@Context +Project1 Not+Project
\
n
| 3| (C) Baz @Context1 +Project1 key:value
\
n
| 4| (C) Drink beer @ home
\
n
| 5| (C) 13 + 29 = 42
\
n
| 2| (D) Bar @Context1 +Project2
\
n
| 6| x 2014-12-12 Completed but with date:2014-12-12
\
n
"
)
self
.
assertEqual
(
self
.
output
,
"| 1| (C)
2015-11-05
Foo @Context2 Not@Context +Project1 Not+Project
\
n
| 3| (C) Baz @Context1 +Project1 key:value
\
n
| 4| (C) Drink beer @ home
\
n
| 5| (C) 13 + 29 = 42
\
n
| 2| (D) Bar @Context1 +Project2
\
n
| 6| x 2014-12-12 Completed but with date:2014-12-12
\
n
"
)
self
.
assertEqual
(
self
.
errors
,
""
)
self
.
assertEqual
(
self
.
errors
,
""
)
def
test_help
(
self
):
def
test_help
(
self
):
...
...
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