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
b0eab341
Commit
b0eab341
authored
Oct 31, 2014
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When -x is given, do not add the LimitFilter.
parent
c20b2ef2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
4 deletions
+33
-4
test/ListCommandTest.py
test/ListCommandTest.py
+30
-3
topydo/lib/ListCommand.py
topydo/lib/ListCommand.py
+3
-1
No files found.
test/ListCommandTest.py
View file @
b0eab341
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
# You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
Config
import
CommandTest
import
CommandTest
import
ListCommand
import
ListCommand
import
TestFacilities
import
TestFacilities
...
@@ -94,6 +95,32 @@ class ListCommandTest(CommandTest.CommandTest):
...
@@ -94,6 +95,32 @@ class ListCommandTest(CommandTest.CommandTest):
self
.
assertEquals
(
self
.
output
,
" 2 (D) Bar @Context1 +Project2 p:1
\
n
"
)
self
.
assertEquals
(
self
.
output
,
" 2 (D) Bar @Context1 +Project2 p:1
\
n
"
)
self
.
assertEquals
(
self
.
errors
,
""
)
self
.
assertEquals
(
self
.
errors
,
""
)
def
test_list11
(
self
):
old_limit
=
Config
.
LIST_LIMIT
Config
.
LIST_LIMIT
=
1
command
=
ListCommand
.
ListCommand
([
"project"
],
self
.
todolist
,
self
.
out
,
self
.
errors
)
command
.
execute
()
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertEquals
(
self
.
output
,
" 1 (C) Foo @Context2 Not@Context +Project1 Not+Project
\
n
"
)
self
.
assertEquals
(
self
.
errors
,
""
)
Config
.
LIST_LIMIT
=
old_limit
def
test_list12
(
self
):
old_limit
=
Config
.
LIST_LIMIT
Config
.
LIST_LIMIT
=
1
command
=
ListCommand
.
ListCommand
([
"-x"
,
"project"
],
self
.
todolist
,
self
.
out
,
self
.
errors
)
command
.
execute
()
self
.
assertFalse
(
self
.
todolist
.
is_dirty
())
self
.
assertEquals
(
self
.
output
,
" 1 (C) Foo @Context2 Not@Context +Project1 Not+Project
\
n
3 (C) Baz @Context1 +Project1 key:value id:1
\
n
2 (D) Bar @Context1 +Project2 p:1
\
n
"
)
self
.
assertEquals
(
self
.
errors
,
""
)
Config
.
LIST_LIMIT
=
old_limit
def
test_help
(
self
):
def
test_help
(
self
):
command
=
ListCommand
.
ListCommand
([
"help"
],
self
.
todolist
,
self
.
out
,
self
.
error
)
command
=
ListCommand
.
ListCommand
([
"help"
],
self
.
todolist
,
self
.
out
,
self
.
error
)
command
.
execute
()
command
.
execute
()
...
...
topydo/lib/ListCommand.py
View file @
b0eab341
...
@@ -59,6 +59,8 @@ class ListCommand(Command.Command):
...
@@ -59,6 +59,8 @@ class ListCommand(Command.Command):
filters
.
append
(
Filter
.
RelevanceFilter
())
filters
.
append
(
Filter
.
RelevanceFilter
())
grep_filters
()
grep_filters
()
if
not
self
.
show_all
:
filters
.
append
(
Filter
.
LimitFilter
(
Config
.
LIST_LIMIT
))
filters
.
append
(
Filter
.
LimitFilter
(
Config
.
LIST_LIMIT
))
return
filters
return
filters
...
...
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