Exemplo n.º 1
0
 def test_on_sample_error(self):
     element = ConcurrencyThreadGroup(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.concurrency.ConcurrencyThreadGroup']['stringProp']:
         if tag['@name'] == 'ThreadGroup.on_sample_error':
             assert tag['#text'] == 'startnextloop'
Exemplo n.º 2
0
 def test_target_rate(self):
     element = ConcurrencyThreadGroup(target_concurrency=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.concurrency.ConcurrencyThreadGroup']['stringProp']:
         if tag['@name'] == 'TargetLevel':
             assert tag['#text'] == '50'
Exemplo n.º 3
0
 def test_filename(self):
     element = ConcurrencyThreadGroup(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.concurrency.ConcurrencyThreadGroup']['stringProp']:
         if tag['@name'] == 'LogFilename':
             assert tag['#text'] == 'file'
Exemplo n.º 4
0
 def test_unit(self):
     element = ConcurrencyThreadGroup(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.concurrency.ConcurrencyThreadGroup']['stringProp']:
         if tag['@name'] == 'Unit':
             assert tag['#text'] == 'S'
Exemplo n.º 5
0
 def test_check(self):
     with pytest.raises(TypeError):
         ConcurrencyThreadGroup(target_concurrency="1")
Exemplo n.º 6
0
 def test_positive2(self):
     ConcurrencyThreadGroup(iterations=0)
Exemplo n.º 7
0
 def test_check2(self):
     with pytest.raises(TypeError):
         ConcurrencyThreadGroup(iterations=-1)
Exemplo n.º 8
0
 def test_positive2(self):
     ConcurrencyThreadGroup(hold=0)
Exemplo n.º 9
0
 def test_check2(self):
     with pytest.raises(TypeError):
         ConcurrencyThreadGroup(hold=-1)
Exemplo n.º 10
0
 def test_positive2(self):
     ConcurrencyThreadGroup(steps=0)
Exemplo n.º 11
0
 def test_check(self):
     with pytest.raises(TypeError):
         ConcurrencyThreadGroup(steps="1")
Exemplo n.º 12
0
 def test_positive2(self):
     ConcurrencyThreadGroup(ramp_up=0)
Exemplo n.º 13
0
 def test_positive2(self):
     ConcurrencyThreadGroup(target_concurrency=0)