summaryrefslogtreecommitdiff
path: root/kronos/tests/test_cli.py
blob: c3b8e4dcc5fa9ffa75ae481b1a079f277be67e12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# vim: set filencoding=utf8
"""
Test Suite for Command Line UI

@author: Mike Crute (mcrute@ag.com)
@organization: American Greetings Interactive
@date: February 05, 2010
"""


from nose.tools import assert_equals
from kronos.cli import CommandLineUI
from kronos.model import Activity


class TestWhenParsingArgs(object):

    def setup(self):
        args = ['kronos', 'start', 'my action@home', '#stuff', '#good']
        self.ui = CommandLineUI(args)
        self.ui.run()

    def test_should_identify_action(self):
        assert_equals(self.ui.action, 'start')

    def test_should_parse_action(self):
        assert isinstance(self.ui.activity, Activity)
        assert_equals(self.ui.activity.activity, 'my action')
        assert_equals(self.ui.activity.category, 'home')