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
c146d574
Commit
c146d574
authored
Nov 22, 2014
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Various fixes based on pyflakes.
parent
a37294da
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
17 deletions
+13
-17
test/FilterTest.py
test/FilterTest.py
+7
-9
test/ListCommandTest.py
test/ListCommandTest.py
+1
-1
test/RecurrenceTest.py
test/RecurrenceTest.py
+5
-5
test/SorterTest.py
test/SorterTest.py
+0
-2
No files found.
test/FilterTest.py
View file @
c146d574
# Topydo - A todo.txt client written in Python.
# Copyright (C) 2014 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/>.
...
...
@@ -20,9 +20,8 @@ from datetime import date, timedelta
import
unittest
import
Filter
from
TestFacilities
import
*
from
TestFacilities
import
load_file
,
todolist_to_string
,
load_file_to_todolist
import
Todo
import
TodoList
class
FilterTest
(
unittest
.
TestCase
):
def
test_filter3
(
self
):
...
...
@@ -194,16 +193,15 @@ class FilterTest(unittest.TestCase):
self
.
assertEquals
(
todolist_to_string
(
filtered_todos
),
\
todolist_to_string
(
reference
))
def
test_filter20
(
self
):
todos
=
load_file
(
'data/FilterTest3.txt'
)
otf
=
Filter
.
OrdinalTagFilter
(
'due:=2014-11-10'
)
filtered_todos
=
otf
.
filter
(
todos
)
reference
=
load_file
(
'data/FilterTest6-result.txt'
)
self
.
assertEquals
(
todolist_to_string
(
filtered_todos
),
""
)
def
test_filter21
(
self
):
todos
=
load_file
(
'data/FilterTest3.txt'
)
otf
=
Filter
.
OrdinalTagFilter
(
'due:=2014-11-10'
)
...
...
@@ -211,7 +209,7 @@ class FilterTest(unittest.TestCase):
filtered_todos
=
otf
.
filter
(
todos
)
self
.
assertEquals
(
todolist_to_string
(
filtered_todos
),
""
)
def
test_filter22
(
self
):
todos
=
load_file
(
'data/FilterTest3.txt'
)
otf
=
Filter
.
OrdinalTagFilter
(
'due:=2014-11-99'
)
...
...
test/ListCommandTest.py
View file @
c146d574
...
...
@@ -14,7 +14,7 @@
# 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
Config
import
config
,
_Config
from
Config
import
config
import
CommandTest
import
ListCommand
import
TestFacilities
...
...
test/RecurrenceTest.py
View file @
c146d574
# Topydo - A todo.txt client written in Python.
# Copyright (C) 2014 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
...
...
@@ -99,7 +99,7 @@ class RecurrenceTest(unittest.TestCase):
self
.
assertTrue
(
new_todo
.
has_tag
(
config
().
tag_due
()))
self
.
assertEquals
(
new_todo
.
due_date
(),
new_due
)
def
test_startdate
(
self
):
def
test_startdate
1
(
self
):
""" Start date is before due date. """
self
.
todo
.
set_tag
(
config
().
tag_due
(),
date
.
today
().
isoformat
())
yesterday
=
date
.
today
()
-
timedelta
(
1
)
...
...
@@ -110,7 +110,7 @@ class RecurrenceTest(unittest.TestCase):
self
.
assertEquals
(
new_todo
.
start_date
(),
new_start
)
def
test_startdate
(
self
):
def
test_startdate
2
(
self
):
""" Strict recurrence. Start date is before due date. """
due
=
date
.
today
()
-
timedelta
(
1
)
self
.
todo
.
set_tag
(
config
().
tag_due
(),
date
.
today
().
isoformat
())
...
...
@@ -122,7 +122,7 @@ class RecurrenceTest(unittest.TestCase):
self
.
assertEquals
(
new_todo
.
start_date
(),
new_start
)
def
test_startdate
2
(
self
):
def
test_startdate
3
(
self
):
""" Start date equals due date. """
self
.
todo
.
set_tag
(
config
().
tag_due
(),
date
.
today
().
isoformat
())
self
.
todo
.
set_tag
(
config
().
tag_start
(),
date
.
today
().
isoformat
())
...
...
test/SorterTest.py
View file @
c146d574
...
...
@@ -18,8 +18,6 @@ import unittest
from
Config
import
config
import
Sorter
import
TodoList
import
View
from
TestFacilities
import
load_file
,
todolist_to_string
,
load_file_to_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