Пример #1
0
 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)
Пример #2
0
 def test_create_supported(self):
     for_ = For()
     iterations = for_.body
     for creator in (iterations.create_iteration, iterations.create_message,
                     iterations.create_keyword):
         item = creator()
         assert_equal(item.parent, for_)
Пример #3
0
 def test_create_not_supported(self):
     msg = "'robot.result.Iterations' object does not support '{}'."
     for parent in For(), While():
         iterations = parent.body
         for creator in (iterations.create_for, iterations.create_if,
                         iterations.create_try, iterations.create_return):
             assert_raises_with_msg(TypeError, msg.format(creator.__name__),
                                    creator)
Пример #4
0
 def test_create_supported(self):
     for parent in For(), While():
         iterations = parent.body
         for creator in (iterations.create_iteration,
                         iterations.create_message,
                         iterations.create_keyword):
             item = creator()
             assert_equal(item.parent, parent)
Пример #5
0
 def test_deprecated_keyword_specific_properties(self):
     for_ = For(['${x}', '${y}'], 'IN', ['a', 'b', 'c', 'd'])
     for name, expected in [('name', '${x} | ${y} IN [ a | b | c | d ]'),
                            ('args', ()),
                            ('assign', ()),
                            ('tags', Tags()),
                            ('timeout', None)]:
         assert_equal(getattr(for_, name), expected)
Пример #6
0
 def test_for(self):
     self._verify(For())
     self._verify(For().body.create_iteration())
Пример #7
0
 def test_create_not_supported(self):
     iterations = For().body
     for creator in (iterations.create_for,
                     iterations.create_if):
         msg = "'ForIterations' object does not support '%s'." % creator.__name__
         assert_raises_with_msg(TypeError, msg, creator)
Пример #8
0
 def test_for(self):
     self._verify(For())