def __init__( self, *, num_threads: int = 100, initial_delay: int = 0, start_users_count: int = 10, start_users_count_burst: int = 0, start_users_period: int = 30, stop_users_count: int = 5, stop_users_period: int = 1, hold: int = 60, ramp_up: int = 5, on_sample_error: ThreadGroupAction = ThreadGroupAction.CONTINUE, name: str = 'jp@gc - Stepping Thread Group (deprecated)', comments: str = '', is_enabled: bool = True): self.num_threads = num_threads self.initial_delay = initial_delay self.start_users_count = start_users_count self.start_users_count_burst = start_users_count_burst self.start_users_period = start_users_period self.stop_users_count = stop_users_count self.stop_users_period = stop_users_period self.hold = hold self.ramp_up = ramp_up BasicThreadGroup.__init__(self, on_sample_error=on_sample_error, name=name, comments=comments, is_enabled=is_enabled)
def __init__( self, *, schedule: List[dict] = [], on_sample_error: ThreadGroupAction = ThreadGroupAction.CONTINUE, name: str = 'jp@gc - Ultimate Thread Group', comments: str = '', is_enabled: bool = True): self.schedule = schedule BasicThreadGroup.__init__(self, on_sample_error=on_sample_error, name=name, comments=comments, is_enabled=is_enabled)
def __init__(self, log_filename: str = None, unit: Unit = Unit.MINUTE, on_sample_error: ThreadGroupAction = ThreadGroupAction.CONTINUE, name: str = 'BasicBzmThreadGroup', comments: str = '', is_enabled: bool = True): self.log_filename = log_filename self.unit = unit BasicThreadGroup.__init__(self, name=name, comments=comments, is_enabled=is_enabled, on_sample_error=on_sample_error)
def __init__(self, *, continue_forever: bool, loops: int = 1, is_sheduler_enable: bool = False, sheduler_duration: int = 0, sheduler_delay: int = 0, name: str = 'BasicThreadGroup', comments: str = '', is_enabled: bool = True, num_threads: int = 1, ramp_time: int = 0, on_sample_error: ThreadGroupAction = ThreadGroupAction.CONTINUE,): self.continue_forever = continue_forever self.loops = loops self.is_sheduler_enable = is_sheduler_enable self.sheduler_duration = sheduler_duration self.sheduler_delay = sheduler_delay IncludesElements.__init__(self) BasicThreadGroup.__init__(self, name=name, comments=comments, is_enabled=is_enabled, num_threads=num_threads, ramp_time=ramp_time)
def test_check(self): with pytest.raises(TypeError, match=r".*must be ThreadGroupAction*"): BasicThreadGroup(on_sample_error='stopthread')
def test_null_check(self): with pytest.raises(ValueError, match=r".*must be more than 0*"): BasicThreadGroup(num_threads=0)
def test_positive(self): btg = BasicThreadGroup(on_sample_error=ThreadGroupAction.CONTINUE) assert btg.on_sample_error is ThreadGroupAction.CONTINUE
def test_positive3(self): TestPlan().append(BasicThreadGroup())
def test_positive1(self): BasicThreadGroup().append(BasicPreProcessor())
def test_positive(self): btg = BasicThreadGroup(num_threads=10) assert btg.num_threads == 10
def test_negative2(self): with pytest.raises(TypeError): BasicController().append(BasicThreadGroup())
def test_positive7(self): BasicThreadGroup().append(BasicListener())
def test_positive8(self): BasicThreadGroup().append(BasicTimer())
def test_positive5(self): BasicThreadGroup().append(BasicSampler())
def test_positive6(self): BasicThreadGroup().append(BasicAssertion())
def test_positive4(self): BasicThreadGroup().append(BasicConfig())
def test_positive3(self): BasicThreadGroup().append(BasicController())
def test_positive2(self): BasicThreadGroup().append(BasicPostProcessor())
def test_positive(self): btg = BasicThreadGroup(ramp_time=25) assert btg.ramp_time == 25
def test_positive9(self): BasicThreadGroup().append(BasicTestFragment())
def test_check2(self): with pytest.raises(TypeError, match=r".*must be int*"): BasicThreadGroup(ramp_time='random chars')
def test_basic_thread_group_parameter_num_threads_null_check(): with pytest.raises(ValueError, match=r".*must be more than 0*"): BasicThreadGroup(num_threads=0)
def test_basic_thread_group_parameter_num_threads_type_check(): with pytest.raises(TypeError, match=r".*must be int.*"): BasicThreadGroup(num_threads='qweasd')
def test_check(self): with pytest.raises(TypeError, match=r".*must be int.*"): BasicThreadGroup(num_threads='qweasd')
def test_negative2(self): with pytest.raises(TypeError): BasicTestFragment().append(BasicThreadGroup())
def test_less_more_check(self): with pytest.raises(ValueError, match=r".*less than -1*"): BasicThreadGroup(num_threads=-5)
def test_basic_thread_group_parameter_num_threads_less_mone_check(): with pytest.raises(ValueError, match=r".*less than -1*"): BasicThreadGroup(num_threads=-5)
def test_negative2(self): with pytest.raises(TypeError): BasicThreadGroup().append(NonTestElements())