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

tests.test_things3_cli   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 19
dl 0
loc 32
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A Things3CLICase.test_today() 0 11 1
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