コード例 #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")