Example #1
0
   def test_run_batch(self):
      batch = ['test 0', 'test 1', 'test 2']
      prefixes = ['1', '2', '3']
      output_dirs = [self.results_dir] * 3
      runner = ExtractionRunner()
      runner.add_runnable(SelfExtractor)
      runner.run_batch(batch, output_dirs, file_prefixes=prefixes)

      for prefix, text in zip(prefixes, batch):
         result_file_path = os.path.join(self.results_dir, '{0}SelfExtractor.xml'.format(prefix))
         self.assertTrue(os.path.isfile(result_file_path))
         xml = ET.parse(result_file_path).getroot()
         self.assertEqual(xml.text, text)
Example #2
0
    def test_run_batch(self):
        batch = ['test 0', 'test 1', 'test 2']
        prefixes = ['1', '2', '3']
        output_dirs = [self.results_dir] * 3
        runner = ExtractionRunner()
        runner.add_runnable(SelfExtractor)
        runner.run_batch(batch, output_dirs, file_prefixes=prefixes)

        for prefix, text in zip(prefixes, batch):
            result_file_path = os.path.join(
                self.results_dir, '{0}SelfExtractor.xml'.format(prefix))
            self.assertTrue(os.path.isfile(result_file_path))
            xml = ET.parse(result_file_path).getroot()
            self.assertEqual(xml.text, text)