Esempio n. 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'
Esempio n. 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'
Esempio n. 3
0
 def test_name(self):
     with pytest.raises(TypeError):
         FlowControlAction(name=123)
Esempio n. 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'
Esempio n. 5
0
 def test_target(self):
     with pytest.raises(TypeError):
         FlowControlAction(target=-1)
Esempio n. 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'
Esempio n. 7
0
 def test_pause2(self):
     with pytest.raises(ValueError):
         FlowControlAction(pause=-1)
Esempio n. 8
0
 def test_pause(self):
     with pytest.raises(TypeError):
         FlowControlAction(pause='123')
Esempio n. 9
0
 def test_logical_action_on_thread(self):
     with pytest.raises(TypeError):
         FlowControlAction(logical_action_on_thread=1)
Esempio n. 10
0
 def test_enabled(self):
     with pytest.raises(TypeError):
         FlowControlAction(is_enabled="True")
Esempio n. 11
0
 def test_comments(self):
     with pytest.raises(TypeError):
         FlowControlAction(comments=123)