Пример #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")