Passed
Push — master ( b8b83a...5e3ba6 )
by Alexander
01:18
created

tests.test_things3_cli.Things3CLICase.test_today()   A

Complexity

Conditions 1

Size

Total Lines 11
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 9
nop 1
dl 0
loc 11
rs 9.95
c 0
b 0
f 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