コード例 #1
0
ファイル: test_util.py プロジェクト: zifter/yandex-tank
 def phout_multi_read(self):
     with open(self.filename) as f:
         exp = f.read()
     errors = []
     stop = Event()
     mr = FileMultiReader(self.filename, stop)
     threads = [
         Thread(target=self.mock_consumer,
                args=(mr.get_file(i), exp, i, errors),
                name='Thread-%d' % i) for i in [1000, 4000, 8000]
     ]
     [th.start() for th in threads]
     stop.set()
     [th.join() for th in threads]
     mr.close()
     return errors
コード例 #2
0
ファイル: test_util.py プロジェクト: zifter/yandex-tank
 def phout_multi_readline(self):
     errors = []
     stop = Event()
     mr = FileMultiReader(self.filename, stop)
     threads = [
         Thread(target=self.mock_complex_consumer,
                args=(mr.get_file(i), exp, 10, errors),
                name='Thread-%d' % i) for i, exp in
         [(1000, '\n1543699431'), (4000, '815\t0\t200\n1543699487'),
          (8000,
           '10968\t3633\t16\t7283\t36\t7387\t1066\t328\t0\t405\n1543699534'
           )]
     ]
     [th.start() for th in threads]
     stop.set()
     [th.join() for th in threads]
     mr.close()
     return errors
コード例 #3
0
 def get_reader(self):
     if self.reader is None:
         self.reader = PhantomReader(FileMultiReader(self.phout_filename, self.finished).get_file())
     return self.reader
コード例 #4
0
 def setup_class(self):
     stop = Event()
     self.multireader = FileMultiReader('yandextank/plugins/Phantom/tests/phout.dat', stop)
     stop.set()
コード例 #5
0
 def setup_class(self):
     stop = Event()
     self.multireader = FileMultiReader(
         os.path.join(get_test_path(),
                      'yandextank/plugins/Phantom/tests/phout.dat'), stop)
     stop.set()
コード例 #6
0
ファイル: test_reader.py プロジェクト: exprmntr/yandex-tank
 def setup_class(self):
     stop = Event()
     self.multireader = FileMultiReader(os.path.join(PATH, 'phout.dat'), stop)
     stop.set()