def test_status_propertys_with_control_structures(self): for obj in (Break(), Continue(), Return(), For(), For().body.create_iteration(), If(), If().body.create_branch(), Try(), Try().body.create_branch(), While(), While().body.create_iteration()): self._verify_status_propertys(obj)
def test_create_supported(self): for parent in If(), Try(): branches = parent.body for creator in (branches.create_branch, branches.create_message, branches.create_keyword): item = creator() assert_equal(item.parent, parent)
def test_if(self): for name, expected in [('name', ''), ('args', ()), ('assign', ()), ('tags', Tags()), ('timeout', None)]: assert_equal(getattr(If(), name), expected)
def test_create_not_supported(self): msg = "'robot.result.Branches' object does not support '{}'." for parent in If(), Try(): branches = parent.body for creator in (branches.create_for, branches.create_if, branches.create_try, branches.create_return): assert_raises_with_msg(TypeError, msg.format(creator.__name__), creator)
def test_if(self): if_ = If('$x > 0') for name, expected in [('name', '$x > 0'), ('args', ()), ('assign', ()), ('tags', Tags()), ('timeout', None)]: assert_equal(getattr(if_, name), expected)
def test_if(self): self._verify(If()) self._verify(If().body.create_branch())
def test_status_propertys_with_if(self): self._verify_status_propertys(If())
def test_if(self): self._verify(If())