~mtrovo/pomodoro-indicator/main

« back to all changes in this revision

Viewing changes to pomodoro-indicator/tests/pomodoro_state.py

  • Committer: Marcos Alejandro Vanetta
  • Date: 2011-08-26 04:56:46 UTC
  • Revision ID: git-v1:706dcfdd0e620ba9c2a7a9423bcd1fefc9902621
reconfigure towards setup.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import unittest
 
2
from pomodoro-indicator.pomodoro_state import PomodoroState
 
3
 
 
4
class TestPomodoroState(unittest.TestCase):
 
5
 
 
6
    def setUp(self):
 
7
        self.state = PomodoroState()
 
8
 
 
9
    def test_has_all_the_methods(self):
 
10
        """There a list of methods it has to have but do nothing"""
 
11
        methods_list = ["enabled_buttons", "start", "next_state", "pause", "resume"]
 
12
        for method in methods_list:
 
13
            assert hasattr(self.state, method)
 
14
            
 
15
    def test_should_not_be_on_any_state(self):
 
16
        """The super class should not be on any singular state"""
 
17
        states = ["working", "resting", "paused", "waiting"]
 
18
        for state in states:
 
19
            method = getattr(self.state, state)
 
20
            self.assertFalse(method())
 
21
    
 
22
    def test_current_state(self):
 
23
        """Every state should have a name and this method provides it"""
 
24
        self.state.name = "name"
 
25
        self.assertEqual("name", self.state.current_state())
 
26
    
 
27
    def test_wont_work(self):
 
28
        self.assertFalse(True)
 
29
 
 
30
if __name__ == '__main__':
 
31
    unittest.main()