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
ed0d9e06
Commit
ed0d9e06
authored
Feb 12, 2016
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Swap green colors for 16 color range
parent
603692a6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
test/test_progress_color.py
test/test_progress_color.py
+8
-8
topydo/lib/ProgressColor.py
topydo/lib/ProgressColor.py
+1
-1
No files found.
test/test_progress_color.py
View file @
ed0d9e06
...
...
@@ -31,12 +31,12 @@ class ProgressColorTest(TopydoTest):
def
test_progress1
(
self
):
""" Test progress of task with no length """
color
=
progress_color
(
Todo
(
'Foo'
))
self
.
assertEqual
(
color
.
color
,
10
)
self
.
assertEqual
(
color
.
color
,
2
)
def
test_progress2
(
self
):
""" Test progress of task with no length (but with creation date). """
color
=
progress_color
(
Todo
(
'2016-02-11 Foo'
))
self
.
assertEqual
(
color
.
color
,
10
)
self
.
assertEqual
(
color
.
color
,
2
)
def
test_progress3
(
self
):
""" Test progress of task with no length """
...
...
@@ -92,7 +92,7 @@ class ProgressColorTest(TopydoTest):
""" Due tomorrow (creation date) """
color
=
progress_color
(
Todo
(
'2016-01-01 Foo due:2016-01-02'
))
# a length of 14 days is assumed
self
.
assertEqual
(
color
.
color
,
10
)
self
.
assertEqual
(
color
.
color
,
2
)
def
test_progress12
(
self
):
""" Due tomorrow (creation date) """
...
...
@@ -103,7 +103,7 @@ class ProgressColorTest(TopydoTest):
def
test_progress13
(
self
):
""" Due tomorrow (recurrence) """
color
=
progress_color
(
Todo
(
'Foo due:2016-01-02 rec:1d'
))
self
.
assertEqual
(
color
.
color
,
10
)
self
.
assertEqual
(
color
.
color
,
2
)
def
test_progress14
(
self
):
""" Due tomorrow (recurrence) """
...
...
@@ -114,7 +114,7 @@ class ProgressColorTest(TopydoTest):
def
test_progress15
(
self
):
""" Due tomorrow (creation date + recurrence) """
color
=
progress_color
(
Todo
(
'2016-12-01 Foo due:2016-01-02 rec:1d'
))
self
.
assertEqual
(
color
.
color
,
10
)
self
.
assertEqual
(
color
.
color
,
2
)
def
test_progress16
(
self
):
""" Due tomorrow (creation date + recurrence) """
...
...
@@ -125,7 +125,7 @@ class ProgressColorTest(TopydoTest):
def
test_progress17
(
self
):
""" Due tomorrow (creation date + recurrence + start date) """
color
=
progress_color
(
Todo
(
'2016-12-01 Foo due:2016-01-02 rec:1d t:2016-01-02'
))
self
.
assertEqual
(
color
.
color
,
10
)
self
.
assertEqual
(
color
.
color
,
2
)
def
test_progress18
(
self
):
""" Due tomorrow (creation date + recurrence + start date) """
...
...
@@ -136,7 +136,7 @@ class ProgressColorTest(TopydoTest):
def
test_progress19
(
self
):
""" Due tomorrow (creation date + strict recurrence + start date) """
color
=
progress_color
(
Todo
(
'2016-12-01 Foo due:2016-01-02 rec:+1d t:2016-01-02'
))
self
.
assertEqual
(
color
.
color
,
10
)
self
.
assertEqual
(
color
.
color
,
2
)
def
test_progress20
(
self
):
""" Due tomorrow (creation date + strict recurrence + start date) """
...
...
@@ -158,7 +158,7 @@ class ProgressColorTest(TopydoTest):
def
test_progress23
(
self
):
""" Due tomorrow (creation date + start date) """
color
=
progress_color
(
Todo
(
'2016-12-01 Foo due:2016-01-02 t:2015-12-31'
))
self
.
assertEqual
(
color
.
color
,
2
)
self
.
assertEqual
(
color
.
color
,
10
)
def
test_progress24
(
self
):
""" Due tomorrow (creation date + start date) """
...
...
topydo/lib/ProgressColor.py
View file @
ed0d9e06
...
...
@@ -22,8 +22,8 @@ from topydo.lib.Recurrence import relative_date_to_date
def
progress_color
(
p_todo
):
color16_range
=
[
10
,
# light green
2
,
# green
10
,
# light green
3
,
# yellow
1
,
# red
]
...
...
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