Passed
Push — master ( 3e6a93...b6cc82 )
by Alexander
01:56
created

tests.test_things3.Things3Case.test_next()   A

Complexity

Conditions 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nop 1
dl 0
loc 4
rs 10
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 os
0 ignored issues
show
Unused Code introduced by
The import os seems to be unused.
Loading history...
8
from src.things3 import Things3
9
10
class Things3Case(unittest.TestCase):
11
    """Class documentation goes here."""
12
    
0 ignored issues
show
Coding Style introduced by
Trailing whitespace
Loading history...
13
    things3 = Things3(database = 'tests/Things.sqlite3')
0 ignored issues
show
Coding Style introduced by
No space allowed around keyword argument assignment
Loading history...
14
15
    def test_today(self):
16
        """Test Today."""
17
        tasks = self.things3.get_today()
18
        self.assertEqual(1, len(tasks), "foo")
19
20
    def test_inbox(self):
21
        """Test Inbox."""
22
        tasks = self.things3.get_inbox()
23
        self.assertEqual(1, len(tasks))
24
    
0 ignored issues
show
Coding Style introduced by
Trailing whitespace
Loading history...
25
    def test_next(self):
26
        """Test Next."""
27
        tasks = self.things3.get_anytime()
28
        self.assertEqual(4, len(tasks))
29
30
    def test_backlog(self):
31
        """Test Backlog."""
32
        tasks = self.things3.get_someday()
33
        self.assertEqual(1, len(tasks))
34
    
0 ignored issues
show
Coding Style introduced by
Trailing whitespace
Loading history...
35
    def test_upcoming(self):
36
        """Test Upcoming."""
37
        tasks = self.things3.get_upcoming()
38
        self.assertEqual(3, len(tasks))
39
    
0 ignored issues
show
Coding Style introduced by
Trailing whitespace
Loading history...
40
    def test_waiting(self):
41
        """Test Waiting."""
42
        tasks = self.things3.get_waiting()
43
        self.assertEqual(1, len(tasks))
44
    
0 ignored issues
show
Coding Style introduced by
Trailing whitespace
Loading history...
45
    def test_mit(self):
46
        """Test MIT."""
47
        tasks = self.things3.get_mit()
48
        self.assertEqual(0, len(tasks))
49
50
    def test_completed(self):
51
        """Test completed tasks."""
52
        tasks = self.things3.get_completed()
53
        self.assertEqual(1, len(tasks))
54
55
    def test_cancelled(self):
56
        """Test cancelled tasks."""
57
        tasks = self.things3.get_cancelled()
58
        self.assertEqual(1, len(tasks))
59
60
    def test_trashed(self):
61
        """Test trashed tasks."""
62
        tasks = self.things3.get_trashed()
63
        self.assertEqual(3, len(tasks))
64
65
    def test_all(self):
66
        """Test all tasks."""
67
        tasks = self.things3.get_all()
68
        self.assertEqual(13, len(tasks))
69
70
    def test_due(self):
71
        """Test due tasks."""
72
        tasks = self.things3.get_due()
73
        self.assertEqual(1, len(tasks))
74
75
if __name__ == '__main__':
76
    unittest.main()
77