Esempio n. 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)
Esempio n. 2
0
 def test_check2(self):
     with pytest.raises(TypeError):
         BasicStandartThreadGroup(is_sheduler_enable=1)
Esempio n. 3
0
 def test_positive(self):
     btg = BasicStandartThreadGroup(num_threads=10)
     assert btg.num_threads == 10
Esempio n. 4
0
 def test_negative(self):
     with pytest.raises(TypeError):
         BasicStandartThreadGroup(loops=-4)
Esempio n. 5
0
 def test_zero(self):
     BasicStandartThreadGroup(loops=0)
Esempio n. 6
0
 def test_positive(self):
     BasicStandartThreadGroup(loops=23)
Esempio n. 7
0
 def test_check(self):
     with pytest.raises(TypeError):
         BasicStandartThreadGroup(is_sheduler_enable=True,
                                  sheduler_delay="1")
Esempio n. 8
0
 def test_positive(self):
     BasicStandartThreadGroup(is_sheduler_enable=True, sheduler_delay=1)
Esempio n. 9
0
 def test_positive(self):
     BasicStandartThreadGroup(continue_forever=True)
Esempio n. 10
0
 def test_check2(self):
     with pytest.raises(TypeError):
         BasicStandartThreadGroup(continue_forever=1)
Esempio n. 11
0
 def test_check(self):
     with pytest.raises(TypeError):
         BasicStandartThreadGroup(ramp_time='25')
Esempio n. 12
0
 def test_positive(self):
     btg = BasicStandartThreadGroup(ramp_time=25)
     assert btg.ramp_time == 25
Esempio n. 13
0
 def test_null_check(self):
     with pytest.raises(TypeError):
         BasicStandartThreadGroup(num_threads=0)
Esempio n. 14
0
 def test_less_more_check(self):
     with pytest.raises(TypeError):
         BasicStandartThreadGroup(num_threads=-5)
Esempio n. 15
0
 def test_check(self):
     with pytest.raises(ValueError):
         BasicStandartThreadGroup(sheduler_duration=23)
Esempio n. 16
0
 def test_check2(self):
     with pytest.raises(ValueError):
         BasicStandartThreadGroup(sheduler_delay=1)
Esempio n. 17
0
 def test_check(self):
     with pytest.raises(ValueError):
         BasicStandartThreadGroup(continue_forever=True, loops=1)
Esempio n. 18
0
 def test_positive1(self):
     BasicStandartThreadGroup(is_sheduler_enable=True,
                              sheduler_duration=1)
Esempio n. 19
0
 def test_check2(self):
     with pytest.raises(TypeError):
         BasicStandartThreadGroup(loops="a")