Beispiel #1
0
    def state_name(self):
        """
        Return a human-readable name of this task's state.

        :returns: eg. "OPEN"
        """
        return task_states.to_str(self.state)
Beispiel #2
0
def test_unknown_to_str():
    assert task_states.to_str(999) == '(unknown state 999)'
Beispiel #3
0
def test_failed_to_str():
    assert task_states.to_str(5) == 'FAILED'
Beispiel #4
0
def test_assigned_to_str():
    assert task_states.to_str(4) == 'ASSIGNED'
Beispiel #5
0
def test_canceled_to_str():
    assert task_states.to_str(3) == 'CANCELED'
Beispiel #6
0
def test_closed_to_str():
    assert task_states.to_str(2) == 'CLOSED'
Beispiel #7
0
def test_open_to_str():
    assert task_states.to_str(1) == 'OPEN'
Beispiel #8
0
def test_free_to_str():
    assert task_states.to_str(0) == 'FREE'