示例#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)
示例#2
0
def test_unknown_to_str():
    assert task_states.to_str(999) == '(unknown state 999)'
示例#3
0
def test_failed_to_str():
    assert task_states.to_str(5) == 'FAILED'
示例#4
0
def test_assigned_to_str():
    assert task_states.to_str(4) == 'ASSIGNED'
示例#5
0
def test_canceled_to_str():
    assert task_states.to_str(3) == 'CANCELED'
示例#6
0
def test_closed_to_str():
    assert task_states.to_str(2) == 'CLOSED'
示例#7
0
def test_open_to_str():
    assert task_states.to_str(1) == 'OPEN'
示例#8
0
def test_free_to_str():
    assert task_states.to_str(0) == 'FREE'