Пример #1
0
 def test_comments(self):
     element = FlowControlAction(comments='My flow')
     rendered_doc = tag_wrapper(element.to_xml(), self.root_tag)
     parsed_doc = xmltodict.parse(rendered_doc)[self.root_tag]
     for tag in parsed_doc[self.root_tag]['stringProp']:
         if tag['@name'] == 'TestPlan.comments':
             assert tag['#text'] == 'My flow'
Пример #2
0
 def test_logical_action(self):
     element = FlowControlAction(
         logical_action_on_thread=ActionOnThread.STOP)
     rendered_doc = tag_wrapper(element.to_xml(), self.root_tag)
     parsed_doc = xmltodict.parse(rendered_doc)[self.root_tag]
     for tag in parsed_doc[self.root_tag]['intProp']:
         if tag['@name'] == 'ActionProcessor.action':
             assert tag['#text'] == '0'
Пример #3
0
 def test_name(self):
     with pytest.raises(TypeError):
         FlowControlAction(name=123)
Пример #4
0
 def test_is_enabled(self):
     element = FlowControlAction(is_enabled=False)
     rendered_doc = tag_wrapper(element.to_xml(), self.root_tag)
     parsed_doc = xmltodict.parse(rendered_doc)[self.root_tag]
     assert parsed_doc[self.root_tag]['@enabled'] == 'false'
Пример #5
0
 def test_target(self):
     with pytest.raises(TypeError):
         FlowControlAction(target=-1)
Пример #6
0
 def test_name(self):
     element = FlowControlAction(name='My flow')
     rendered_doc = tag_wrapper(element.to_xml(), self.root_tag)
     parsed_doc = xmltodict.parse(rendered_doc)[self.root_tag]
     assert parsed_doc[self.root_tag]['@testname'] == 'My flow'
Пример #7
0
 def test_pause2(self):
     with pytest.raises(ValueError):
         FlowControlAction(pause=-1)
Пример #8
0
 def test_pause(self):
     with pytest.raises(TypeError):
         FlowControlAction(pause='123')
Пример #9
0
 def test_logical_action_on_thread(self):
     with pytest.raises(TypeError):
         FlowControlAction(logical_action_on_thread=1)
Пример #10
0
 def test_enabled(self):
     with pytest.raises(TypeError):
         FlowControlAction(is_enabled="True")
Пример #11
0
 def test_comments(self):
     with pytest.raises(TypeError):
         FlowControlAction(comments=123)