| Total Complexity | 1 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | #!/usr/bin/env python3 |
||
| 2 | # -*- coding: utf-8 -*- |
||
| 3 | |||
| 4 | """Module documentation goes here.""" |
||
| 5 | |||
| 6 | import unittest |
||
| 7 | import io |
||
| 8 | import sys |
||
| 9 | import src.things3_cli |
||
| 10 | from src.things3 import Things3 |
||
| 11 | |||
| 12 | |||
| 13 | class Things3CLICase(unittest.TestCase): |
||
| 14 | """Class documentation goes here.""" |
||
| 15 | |||
| 16 | things3 = Things3(database='tests/Things.sqlite3') |
||
| 17 | |||
| 18 | def test_today(self): |
||
| 19 | """Test Today.""" |
||
| 20 | args = src.things3_cli.get_parser().parse_args(['today']) |
||
| 21 | new_out = io.StringIO() |
||
| 22 | old_out = sys.stdout |
||
| 23 | try: |
||
| 24 | sys.stdout = new_out |
||
| 25 | src.things3_cli.main(args, self.things3) |
||
| 26 | finally: |
||
| 27 | sys.stdout = old_out |
||
| 28 | self.assertIn("Today Todo", new_out.getvalue()) |
||
| 29 | |||
| 30 | if __name__ == '__main__': |
||
| 31 | unittest.main() |
||
| 32 |