def test_on_sample_error(self): element = ArrivalsThreadGroup(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.ArrivalsThreadGroup']['stringProp']: if tag['@name'] == 'ThreadGroup.on_sample_error': assert tag['#text'] == 'startnextloop'
def test_filename(self): element = ArrivalsThreadGroup(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.ArrivalsThreadGroup']['stringProp']: if tag['@name'] == 'LogFilename': assert tag['#text'] == 'file'
def test_unit(self): element = ArrivalsThreadGroup(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.ArrivalsThreadGroup']['stringProp']: if tag['@name'] == 'Unit': assert tag['#text'] == 'S'
def test_concurrency_limit(self): element = ArrivalsThreadGroup(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.ArrivalsThreadGroup']['stringProp']: if tag['@name'] == 'ConcurrencyLimit': assert tag['#text'] == '50'
def test_target_rate(self): element = ArrivalsThreadGroup(target_rate=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.ArrivalsThreadGroup']['stringProp']: if tag['@name'] == 'TargetLevel': assert tag['#text'] == '50'
def test_positive2(self): ArrivalsThreadGroup(concurrency_limit=0)
def test_check(self): with pytest.raises(TypeError): ArrivalsThreadGroup(target_rate="1")
def test_check2(self): with pytest.raises(TypeError): ArrivalsThreadGroup(concurrency_limit=-1)
def test_positive2(self): ArrivalsThreadGroup(iterations=0)
def test_check2(self): with pytest.raises(TypeError): ArrivalsThreadGroup(iterations=-1)
def test_positive2(self): ArrivalsThreadGroup(hold=0)
def test_check2(self): with pytest.raises(TypeError): ArrivalsThreadGroup(hold=-1)
def test_positive2(self): ArrivalsThreadGroup(steps=0)
def test_check(self): with pytest.raises(TypeError): ArrivalsThreadGroup(steps="1")
def test_positive2(self): ArrivalsThreadGroup(ramp_up=0)
def test_positive2(self): ArrivalsThreadGroup(target_rate=0)