summaryrefslogtreecommitdiff
path: root/kronos/tests/test_parser.py
diff options
context:
space:
mode:
Diffstat (limited to 'kronos/tests/test_parser.py')
-rw-r--r--kronos/tests/test_parser.py39
1 files changed, 8 insertions, 31 deletions
diff --git a/kronos/tests/test_parser.py b/kronos/tests/test_parser.py
index 8a82a65..b08152a 100644
--- a/kronos/tests/test_parser.py
+++ b/kronos/tests/test_parser.py
@@ -50,38 +50,15 @@ class TestWhenParsingBasicFormat(object):
50 50
51class TestWhenParsingWithTags(object): 51class TestWhenParsingWithTags(object):
52 52
53 def setup(self):
54 test_input = "my activity@Home, Some cool stuff! #tag1 #tag2"
55 self.results = parse_activity(test_input)
56
57 def test_should_get_tags(self): 53 def test_should_get_tags(self):
58 assert_equals(self.results.tags, ['tag1', 'tag2']) 54 test = parse_activity("my activity@Home, Some cool stuff! #tag1 #tag2")
55 assert_equals(test.tags, ['tag1', 'tag2'])
59 56
60 def test_should_not_include_tags_in_description(self): 57 def test_should_not_include_tags_in_description(self):
61 assert_equals(self.results.description, "Some cool stuff!") 58 test = parse_activity("my activity@Home, Some cool stuff! #tag1 #tag2")
62 59 assert_equals(test.description, "Some cool stuff!")
63
64# TODO: Implement this functionality when I need it.
65class TestWhenParsingWithTimeOffset(object):
66
67 def test_should_understand_minutes(self):
68 test_input = "my activity@Home, Some cool stuff! 10m"
69 test_input = "my activity@Home, Some cool stuff! 10M"
70
71 def test_should_understand_hours(self):
72 test_input = "my activity@Home, Some cool stuff! 10h"
73 test_input = "my activity@Home, Some cool stuff! 10H"
74
75 def test_should_understand_seconds(self):
76 test_input = "my activity@Home, Some cool stuff! 10s"
77 test_input = "my activity@Home, Some cool stuff! 10S"
78
79
80class TestWhenParsingWithAbsoluteTime(object):
81
82 def test_should_understand_military_time(self):
83 test_input = "my activity@Home, Some cool stuff! 11:30-14:40"
84 60
85 def test_should_understand_simple_time(self): 61 def test_should_not_include_tags_in_category(self):
86 test_input = "my activity@Home, Some cool stuff! 11:30AM-2:40PM" 62 test = parse_activity("my activity@Home #tag1 #tag2")
87 test_input = "my activity@Home, Some cool stuff! 11:30A-2:40P" 63 assert_equals(test.tags, ['tag1', 'tag2'])
64 assert_equals(test.category, 'Home')