示例#1
0
 def testRunFileStdoutPiping(self):
     file_path = self.GetTestFilePath('simple.js')
     tmp_dir = tempfile.mkdtemp()
     try:
         temp_file_name = os.path.join(tmp_dir, 'out_file')
         with open(temp_file_name, 'w') as f:
             d8_runner.RunFile(file_path, stdout=f)
         with open(temp_file_name, 'r') as f:
             self.assertEquals(f.read(), 'Hello W0rld from simple.js\n')
     finally:
         shutil.rmtree(tmp_dir)
示例#2
0
 def testQuit274Handling(self):
     file_path = self.GetTestFilePath('quit_274_test.js')
     res = d8_runner.RunFile(file_path, source_paths=[self.test_data_dir])
     self.assertEquals(res.returncode, 238)