Example #1
0
 def __init__(self, *,
              num_threads: int = 1,
              ramp_time: int = 0,
              continue_forever: bool = False,
              loops: int = None,
              delayed_start: bool = False,
              is_sheduler_enable: bool = False,
              sheduler_duration: int = None,
              sheduler_delay: int = None,
              on_sample_error: ThreadGroupAction = ThreadGroupAction.CONTINUE,
              name: str = 'Thread Group',
              comments: str = '',
              is_enabled: bool = True,):
     self.delayed_start = delayed_start
     BasicStandartThreadGroup.__init__(self, name=name,
                                       comments=comments,
                                       is_enabled=is_enabled,
                                       num_threads=num_threads,
                                       ramp_time=ramp_time,
                                       continue_forever=continue_forever,
                                       loops=loops,
                                       is_sheduler_enable=is_sheduler_enable,
                                       sheduler_duration=sheduler_duration,
                                       sheduler_delay=sheduler_delay,
                                       on_sample_error=on_sample_error)
Example #2
0
 def test_check2(self):
     with pytest.raises(TypeError):
         BasicStandartThreadGroup(is_sheduler_enable=1)
Example #3
0
 def test_positive(self):
     btg = BasicStandartThreadGroup(num_threads=10)
     assert btg.num_threads == 10
Example #4
0
 def test_negative(self):
     with pytest.raises(TypeError):
         BasicStandartThreadGroup(loops=-4)
Example #5
0
 def test_zero(self):
     BasicStandartThreadGroup(loops=0)
Example #6
0
 def test_positive(self):
     BasicStandartThreadGroup(loops=23)
Example #7
0
 def test_check(self):
     with pytest.raises(TypeError):
         BasicStandartThreadGroup(is_sheduler_enable=True,
                                  sheduler_delay="1")
Example #8
0
 def test_positive(self):
     BasicStandartThreadGroup(is_sheduler_enable=True, sheduler_delay=1)
Example #9
0
 def test_positive(self):
     BasicStandartThreadGroup(continue_forever=True)
Example #10
0
 def test_check2(self):
     with pytest.raises(TypeError):
         BasicStandartThreadGroup(continue_forever=1)
Example #11
0
 def test_check(self):
     with pytest.raises(TypeError):
         BasicStandartThreadGroup(ramp_time='25')
Example #12
0
 def test_positive(self):
     btg = BasicStandartThreadGroup(ramp_time=25)
     assert btg.ramp_time == 25
Example #13
0
 def test_null_check(self):
     with pytest.raises(TypeError):
         BasicStandartThreadGroup(num_threads=0)
Example #14
0
 def test_less_more_check(self):
     with pytest.raises(TypeError):
         BasicStandartThreadGroup(num_threads=-5)
Example #15
0
 def test_check(self):
     with pytest.raises(ValueError):
         BasicStandartThreadGroup(sheduler_duration=23)
Example #16
0
 def test_check2(self):
     with pytest.raises(ValueError):
         BasicStandartThreadGroup(sheduler_delay=1)
Example #17
0
 def test_check(self):
     with pytest.raises(ValueError):
         BasicStandartThreadGroup(continue_forever=True, loops=1)
Example #18
0
 def test_positive1(self):
     BasicStandartThreadGroup(is_sheduler_enable=True,
                              sheduler_duration=1)
Example #19
0
 def test_check2(self):
     with pytest.raises(TypeError):
         BasicStandartThreadGroup(loops="a")