Example #1
0
 def test_concurrency_limit(self):
     element = FreeFormArrivalsThreadGroup(concurrency_limit=50)
     rendered_doc = element.to_xml()
     parsed_doc = xmltodict.parse(tag_wrapper(rendered_doc, 'test_results'))
     for tag in parsed_doc['test_results']['com.blazemeter.jmeter.threads.arrivals.FreeFormArrivalsThreadGroup']['stringProp']:
         if tag['@name'] == 'ConcurrencyLimit':
             assert tag['#text'] == '50'
Example #2
0
 def test_filename(self):
     element = FreeFormArrivalsThreadGroup(log_filename='file')
     rendered_doc = element.to_xml()
     parsed_doc = xmltodict.parse(tag_wrapper(rendered_doc, 'test_results'))
     for tag in parsed_doc['test_results']['com.blazemeter.jmeter.threads.arrivals.FreeFormArrivalsThreadGroup']['stringProp']:
         if tag['@name'] == 'LogFilename':
             assert tag['#text'] == 'file'
Example #3
0
 def test_unit(self):
     element = FreeFormArrivalsThreadGroup(unit=Unit.SECOND)
     rendered_doc = element.to_xml()
     parsed_doc = xmltodict.parse(tag_wrapper(rendered_doc, 'test_results'))
     for tag in parsed_doc['test_results']['com.blazemeter.jmeter.threads.arrivals.FreeFormArrivalsThreadGroup']['stringProp']:
         if tag['@name'] == 'Unit':
             assert tag['#text'] == 'S'
Example #4
0
 def test_on_sample_error(self):
     element = FreeFormArrivalsThreadGroup(on_sample_error=ThreadGroupAction.START_NEXT_LOOP)
     rendered_doc = element.to_xml()
     parsed_doc = xmltodict.parse(tag_wrapper(rendered_doc, 'test_results'))
     for tag in parsed_doc['test_results']['com.blazemeter.jmeter.threads.arrivals.FreeFormArrivalsThreadGroup']['stringProp']:
         if tag['@name'] == 'ThreadGroup.on_sample_error':
             assert tag['#text'] == 'startnextloop'
Example #5
0
 def test_target_rate(self):
     element = FreeFormArrivalsThreadGroup(schedule=[{"start": 1, "end": 2, "duration": 3}])
     rendered_doc = element.to_xml()
     parsed_doc = xmltodict.parse(tag_wrapper(rendered_doc, 'test_results'))
     for tag in parsed_doc['test_results']['com.blazemeter.jmeter.threads.arrivals.FreeFormArrivalsThreadGroup']['collectionProp']['collectionProp']['stringProp']:
         if tag['@name'] == '49':
             assert tag['#text'] == '1'
Example #6
0
 def test_check(self):
     with pytest.raises(TypeError):
         FreeFormArrivalsThreadGroup(schedule="1")
Example #7
0
 def test_positive2(self):
     FreeFormArrivalsThreadGroup(concurrency_limit=0)
Example #8
0
 def test_check2(self):
     with pytest.raises(TypeError):
         FreeFormArrivalsThreadGroup(concurrency_limit=-1)
Example #9
0
 def test_positive2(self):
     FreeFormArrivalsThreadGroup(iterations=0)
Example #10
0
 def test_check2(self):
     with pytest.raises(TypeError):
         FreeFormArrivalsThreadGroup(iterations=-1)
Example #11
0
 def test_positive(self):
     FreeFormArrivalsThreadGroup(schedule=[{"start": 1, "end": 1, "duration": 1}])
Example #12
0
 def test_check5(self):
     with pytest.raises(ValueError):
         FreeFormArrivalsThreadGroup(schedule=[{"start": 1, "end": 1}])
Example #13
0
 def test_check4(self):
     with pytest.raises(TypeError):
         FreeFormArrivalsThreadGroup(schedule=[{"start": -1, "end": 1, "duration": 1}])