@@ -30,6 +30,10 @@ def setUp(self):
30
30
self .h_no_date = Heading .parse_heading_from_data (tmp ,
31
31
self .allowed_todo_states )
32
32
33
+ tmp = ["* This heading has an incative date [2011-08-26 Fri]" ]
34
+ self .h_no_date_2 = Heading .parse_heading_from_data (tmp , self .allowed_todo_states )
35
+
36
+
33
37
def test_heading_parsing_no_date (self ):
34
38
"""""
35
39
'text' doesn't contain any valid date.
@@ -38,15 +42,7 @@ def test_heading_parsing_no_date(self):
38
42
h = Heading .parse_heading_from_data (text , self .allowed_todo_states )
39
43
self .assertEqual (None , h .active_date )
40
44
41
- text = ["* TODO This is a test <2011-08-25>" ]
42
- h = Heading .parse_heading_from_data (text , self .allowed_todo_states )
43
- self .assertEqual (None , h .active_date )
44
-
45
- text = ["* TODO This is a test <2011-08-25 Wednesday>" ]
46
- h = Heading .parse_heading_from_data (text , self .allowed_todo_states )
47
- self .assertEqual (None , h .active_date )
48
-
49
- text = ["* TODO This is a test <20110825>" ]
45
+ text = ["* TODO This is a test" ]
50
46
h = Heading .parse_heading_from_data (text , self .allowed_todo_states )
51
47
self .assertEqual (None , h .active_date )
52
48
@@ -66,6 +62,7 @@ def test_heading_parsing_with_date(self):
66
62
h = Heading .parse_heading_from_data (text , self .allowed_todo_states )
67
63
self .assertEqual (odate , h .active_date )
68
64
65
+
69
66
def test_heading_parsing_with_date_and_body (self ):
70
67
"""""
71
68
'text' contains valid dates (in the body).
@@ -148,6 +145,11 @@ def test_sorting_of_headings(self):
148
145
[self .h1 , self .h2_datetime , self .h2 , self .h3 , self .h_no_date ],
149
146
sorted ([self .h2_datetime , self .h3 , self .h2 , self .h_no_date , self .h1 ]))
150
147
148
+ self .assertEqual (
149
+ [self .h1 , self .h2_datetime , self .h2 , self .h3 ,
150
+ self .h_no_date_2 ],
151
+ sorted ([self .h2_datetime , self .h3 , self .h2 ,
152
+ self .h_no_date_2 , self .h1 ]))
151
153
152
154
def suite ():
153
155
return unittest .TestLoader ().loadTestsFromTestCase (
0 commit comments