diff options
author | Mike Crute <mcrute@gmail.com> | 2010-02-07 14:20:47 -0500 |
---|---|---|
committer | Mike Crute <mcrute@gmail.com> | 2010-02-07 14:20:47 -0500 |
commit | 011c9ce431a50fdac1a74e58cadbb63975e98628 (patch) | |
tree | 2028dc9064b1f6bd0455ccc8849c24687d47672e | |
parent | f4bcc526fd335c699231513748d01277b4542fd2 (diff) | |
download | kronos-011c9ce431a50fdac1a74e58cadbb63975e98628.tar.bz2 kronos-011c9ce431a50fdac1a74e58cadbb63975e98628.tar.xz kronos-011c9ce431a50fdac1a74e58cadbb63975e98628.zip |
Adding test for invalid action.
-rw-r--r-- | kronos/cli.py | 6 | ||||
-rw-r--r-- | kronos/tests/test_cli.py | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/kronos/cli.py b/kronos/cli.py index 72f0676..9e3e3bf 100644 --- a/kronos/cli.py +++ b/kronos/cli.py | |||
@@ -46,9 +46,5 @@ class CommandLineUI(object): | |||
46 | controller(self.activity) | 46 | controller(self.activity) |
47 | 47 | ||
48 | 48 | ||
49 | def main(): | ||
50 | CommandLineUI(sys.argv[:]).run() | ||
51 | |||
52 | |||
53 | if __name__ == "__main__": | 49 | if __name__ == "__main__": |
54 | main() | 50 | CommandLineUI(sys.argv[:]).run() |
diff --git a/kronos/tests/test_cli.py b/kronos/tests/test_cli.py index 54aef81..a826a7e 100644 --- a/kronos/tests/test_cli.py +++ b/kronos/tests/test_cli.py | |||
@@ -34,3 +34,9 @@ class TestParsingErrors(object): | |||
34 | def test_should_exit_if_not_enough_args(self): | 34 | def test_should_exit_if_not_enough_args(self): |
35 | ui = CommandLineUI([]) | 35 | ui = CommandLineUI([]) |
36 | assert_raises(SystemExit, ui.run) | 36 | assert_raises(SystemExit, ui.run) |
37 | |||
38 | def test_should_exit_if_invalid_controller(self): | ||
39 | args = ['kronos', 'ducks', 'my action@home', '#stuff', '#good'] | ||
40 | ui = CommandLineUI(args) | ||
41 | |||
42 | assert_raises(SystemExit, ui.run) | ||