Пример #1
0
 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)
Пример #2
0
 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)
Пример #3
0
 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)
Пример #4
0
 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
Пример #8
0
 def test_positive3(self):
     TestPlan().append(BasicThreadGroup())
Пример #9
0
 def test_positive1(self):
     BasicThreadGroup().append(BasicPreProcessor())
 def test_positive(self):
     btg = BasicThreadGroup(num_threads=10)
     assert btg.num_threads == 10
Пример #11
0
 def test_negative2(self):
     with pytest.raises(TypeError):
         BasicController().append(BasicThreadGroup())
Пример #12
0
 def test_positive7(self):
     BasicThreadGroup().append(BasicListener())
Пример #13
0
 def test_positive8(self):
     BasicThreadGroup().append(BasicTimer())
Пример #14
0
 def test_positive5(self):
     BasicThreadGroup().append(BasicSampler())
Пример #15
0
 def test_positive6(self):
     BasicThreadGroup().append(BasicAssertion())
Пример #16
0
 def test_positive4(self):
     BasicThreadGroup().append(BasicConfig())
Пример #17
0
 def test_positive3(self):
     BasicThreadGroup().append(BasicController())
Пример #18
0
 def test_positive2(self):
     BasicThreadGroup().append(BasicPostProcessor())
 def test_positive(self):
     btg = BasicThreadGroup(ramp_time=25)
     assert btg.ramp_time == 25
Пример #20
0
 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')
Пример #22
0
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)
Пример #23
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)
Пример #27
0
def test_basic_thread_group_parameter_num_threads_less_mone_check():
    with pytest.raises(ValueError, match=r".*less than -1*"):
        BasicThreadGroup(num_threads=-5)
Пример #28
0
 def test_negative2(self):
     with pytest.raises(TypeError):
         BasicThreadGroup().append(NonTestElements())