示例#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'
示例#2
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'
示例#3
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'
示例#4
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'
示例#5
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'
示例#6
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'
示例#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'
示例#8
0
 def test_comments(self):
     with pytest.raises(TypeError):
         BackendListener(comments=123)
示例#9
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'
示例#10
0
 def test_event_tags(self):
     with pytest.raises(TypeError):
         BackendListener(event_tags=5)
示例#11
0
 def test_test_title(self):
     with pytest.raises(TypeError):
         BackendListener(BackendListener=-1)
示例#12
0
 def test_percentilies2(self):
     with pytest.raises(Exception):
         BackendListener(percentilies='102;100')
示例#13
0
 def test_async_queue_size(self):
     with pytest.raises(TypeError):
         BackendListener(async_queue_size='1')
示例#14
0
 def test_samplers_regexp2(self):
     with pytest.raises(TypeError):
         BackendListener(samplers_regexp=123)
示例#15
0
 def test_summary_only(self):
     with pytest.raises(TypeError):
         BackendListener(summary_only='True')
示例#16
0
 def test_measurement(self):
     with pytest.raises(TypeError):
         BackendListener(measurement=2)
示例#17
0
 def test_application(self):
     with pytest.raises(TypeError):
         BackendListener(application=123)
示例#18
0
 def test_influx_db_url(self):
     with pytest.raises(TypeError):
         BackendListener(influx_db_url=13)
示例#19
0
 def test_name(self):
     with pytest.raises(TypeError):
         BackendListener(name=123)
示例#20
0
 def test_percentilies(self):
     with pytest.raises(TypeError):
         BackendListener(percentilies=-1)
示例#21
0
 def test_samplers_regexp(self):
     with pytest.raises(Exception):
         BackendListener(samplers_regexp='[')
示例#22
0
 def test_enabled(self):
     with pytest.raises(TypeError):
         BackendListener(is_enabled="True")