def state_name(self): """ Return a human-readable name of this task's state. :returns: eg. "OPEN" """ return task_states.to_str(self.state)
def test_unknown_to_str(): assert task_states.to_str(999) == '(unknown state 999)'
def test_failed_to_str(): assert task_states.to_str(5) == 'FAILED'
def test_assigned_to_str(): assert task_states.to_str(4) == 'ASSIGNED'
def test_canceled_to_str(): assert task_states.to_str(3) == 'CANCELED'
def test_closed_to_str(): assert task_states.to_str(2) == 'CLOSED'
def test_open_to_str(): assert task_states.to_str(1) == 'OPEN'
def test_free_to_str(): assert task_states.to_str(0) == 'FREE'