Beispiel #1
0
def test_assignment_exceptions():

    s = Stage()

    data_type = [1, 'a', True, [1], set([1])]

    for data in data_type:

        if not isinstance(data, str):
            with pytest.raises(TypeError):
                s.name = data

        with pytest.raises(TypeError):
            s.tasks = data

        with pytest.raises(TypeError):
            s.add_tasks(data)

        if not isinstance(data, str):
            with pytest.raises(TypeError):
                s.remove_tasks(data)

            with pytest.raises(TypeError):
                s._set_task_state(data)