Example #1
0
 def test_render_comments(self):
     element = BackendListener(comments='My comment')
     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 comment'
Example #2
0
 def test_influx_db_url(self):
     element = BackendListener(influx_db_url='localhost')
     rendered_doc = tag_wrapper(element.to_xml(), self.root_tag)
     parsed_doc = xmltodict.parse(rendered_doc)[self.root_tag]
     temp = parsed_doc[self.root_tag]['elementProp']['collectionProp']['elementProp'][1]['stringProp'][1]
     for key in temp:
         if key == '#text':
             assert temp[key] == 'localhost'
Example #3
0
 def test_event_tags(self):
     element = BackendListener(event_tags='tag for fun')
     rendered_doc = tag_wrapper(element.to_xml(), self.root_tag)
     parsed_doc = xmltodict.parse(rendered_doc)[self.root_tag]
     temp = parsed_doc[self.root_tag]['elementProp']['collectionProp']['elementProp'][8]['stringProp'][1]
     for key in temp:
         if key == '#text':
             assert temp[key] == 'tag for fun'
Example #4
0
 def test_samplers_regexp(self):
     element = BackendListener(samplers_regexp='\d\w')
     rendered_doc = tag_wrapper(element.to_xml(), self.root_tag)
     parsed_doc = xmltodict.parse(rendered_doc)[self.root_tag]
     temp = parsed_doc[self.root_tag]['elementProp']['collectionProp']['elementProp'][5]['stringProp'][1]
     for key in temp:
         if key == '#text':
             assert temp[key] == '\d\w'
Example #5
0
 def test_summery_only(self):
     element = BackendListener(summary_only=False)
     rendered_doc = tag_wrapper(element.to_xml(), self.root_tag)
     parsed_doc = xmltodict.parse(rendered_doc)[self.root_tag]
     temp = parsed_doc[self.root_tag]['elementProp']['collectionProp']['elementProp'][4]['stringProp'][1]
     for key in temp:
         if key == '#text':
             assert temp[key] == 'false'
Example #6
0
 def test_measurement(self):
     element = BackendListener(measurement='my mess')
     rendered_doc = tag_wrapper(element.to_xml(), self.root_tag)
     parsed_doc = xmltodict.parse(rendered_doc)[self.root_tag]
     temp = parsed_doc[self.root_tag]['elementProp']['collectionProp']['elementProp'][3]['stringProp'][1]
     for key in temp:
         if key == '#text':
             assert temp[key] == 'my mess'
Example #7
0
 def test_render_is_enabled(self):
     element = BackendListener(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'
Example #8
0
 def test_render_name(self):
     element = BackendListener(name='My backend')
     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 backend'