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