コード例 #1
0
 def test_cached_stpd_info(self):
     self.phantom_plugin_instance.core.set_option('phantom', 'stpd_file', 'data/dummy.ammo.stpd')
     wrapper = StepperWrapper(self.phantom_plugin_instance.core, PhantomPlugin.SECTION)
     wrapper.read_config()
     wrapper.prepare_stepper()
     self.assertEqual(10, wrapper.instances)
     self.assertEqual(60, wrapper.duration)
コード例 #2
0
    def test_cached_stepper_instances_sched(self):
        # Making cache file
        self.phantom_plugin_instance.core.set_option('phantom', 'instances',
                                                     '1000')
        self.phantom_plugin_instance.core.set_option('phantom', 'rps_schedule',
                                                     '')
        self.phantom_plugin_instance.core.set_option('phantom',
                                                     'instances_schedule',
                                                     'line(1,100,1m)')
        self.phantom_plugin_instance.core.set_option('phantom', 'ammo_file',
                                                     'data/dummy.ammo')
        wrapper = StepperWrapper(self.phantom_plugin_instance.core,
                                 PhantomPlugin.SECTION)
        wrapper.read_config()
        wrapper.prepare_stepper()
        self.tearDown()

        self.setUp()
        self.phantom_plugin_instance.core.set_option('phantom', 'instances',
                                                     '1000')
        self.phantom_plugin_instance.core.set_option('phantom', 'rps_schedule',
                                                     '')
        self.phantom_plugin_instance.core.set_option('phantom',
                                                     'instances_schedule',
                                                     'line(1,100,1m)')
        self.phantom_plugin_instance.core.set_option('phantom', 'ammo_file',
                                                     'data/dummy.ammo')
        wrapper = StepperWrapper(self.phantom_plugin_instance.core,
                                 PhantomPlugin.SECTION)
        wrapper.read_config()
        wrapper.prepare_stepper()
        self.assertEqual(100, wrapper.instances)
コード例 #3
0
 def test_multiload_parsing(self):
     core = self.get_core()
     foo = StepperWrapper(core, PhantomPlugin.SECTION)
     foo.core.set_option('phantom', 'rps_schedule',
                         'const(1,1) line(1,100,60)\nstep(1,10,1,10)')
     foo.read_config()
     self.assertEquals(['const(1,1)', 'line(1,100,60)', 'step(1,10,1,10)'],
                       foo.rps_schedule)
コード例 #4
0
 def test_stepper_instances_override(self):
     self.phantom_plugin_instance.core.set_option('phantom', 'instances', '20000')
     self.phantom_plugin_instance.core.set_option('phantom', 'rps_schedule', 'line(1,100,1m)')
     self.phantom_plugin_instance.core.set_option('phantom', 'use_caching', '0')
     self.phantom_plugin_instance.core.set_option('phantom', 'ammo_file', 'data/dummy.ammo')
     wrapper = StepperWrapper(self.phantom_plugin_instance.core, PhantomPlugin.SECTION)
     wrapper.read_config()
     wrapper.prepare_stepper()
     self.assertEqual(20000, wrapper.instances)
コード例 #5
0
 def test_cached_stpd_info(self):
     self.phantom_plugin_instance.core.set_option('phantom', 'stpd_file',
                                                  'data/dummy.ammo.stpd')
     wrapper = StepperWrapper(self.phantom_plugin_instance.core,
                              PhantomPlugin.SECTION)
     wrapper.read_config()
     wrapper.prepare_stepper()
     self.assertEqual(10, wrapper.instances)
     self.assertEqual(60, wrapper.duration)
コード例 #6
0
 def test_stepper_instances_override(self):
     self.phantom_plugin_instance.core.set_option('phantom', 'instances',
                                                  '20000')
     self.phantom_plugin_instance.core.set_option('phantom', 'rps_schedule',
                                                  'line(1,100,1m)')
     self.phantom_plugin_instance.core.set_option('phantom', 'use_caching',
                                                  '0')
     self.phantom_plugin_instance.core.set_option('phantom', 'ammo_file',
                                                  'data/dummy.ammo')
     wrapper = StepperWrapper(self.phantom_plugin_instance.core,
                              PhantomPlugin.SECTION)
     wrapper.read_config()
     wrapper.prepare_stepper()
     self.assertEqual(20000, wrapper.instances)
コード例 #7
0
    def test_cached_stepper_instances_sched(self):
        # Making cache file
        self.phantom_plugin_instance.core.set_option('phantom', 'instances', '1000')
        self.phantom_plugin_instance.core.set_option('phantom', 'rps_schedule', '')
        self.phantom_plugin_instance.core.set_option('phantom', 'instances_schedule', 'line(1,100,1m)')
        self.phantom_plugin_instance.core.set_option('phantom', 'ammo_file', 'data/dummy.ammo')
        wrapper = StepperWrapper(self.phantom_plugin_instance.core, PhantomPlugin.SECTION)
        wrapper.read_config()
        wrapper.prepare_stepper()
        self.tearDown()

        self.setUp()
        self.phantom_plugin_instance.core.set_option('phantom', 'instances', '1000')
        self.phantom_plugin_instance.core.set_option('phantom', 'rps_schedule', '')
        self.phantom_plugin_instance.core.set_option('phantom', 'instances_schedule', 'line(1,100,1m)')
        self.phantom_plugin_instance.core.set_option('phantom', 'ammo_file', 'data/dummy.ammo')
        wrapper = StepperWrapper(self.phantom_plugin_instance.core, PhantomPlugin.SECTION)
        wrapper.read_config()
        wrapper.prepare_stepper()
        self.assertEqual(100, wrapper.instances)
コード例 #8
0
 def test_multiload_parsing(self):
     core = self.get_core()
     foo = StepperWrapper(core, PhantomPlugin.SECTION)
     foo.core.set_option('phantom', 'rps_schedule', 'const(1,1) line(1,100,60)\nstep(1,10,1,10)')
     foo.read_config()
     self.assertEquals(['const(1,1)', 'line(1,100,60)', 'step(1,10,1,10)'], foo.rps_schedule)