1#!/usr/bin/env vpython3 2 3# Copyright 2021 The Chromium Authors 4# Use of this source code is governed by a BSD-style license that can be 5# found in the LICENSE file. 6 7import argparse 8import json 9import os 10from pyfakefs import fake_filesystem_unittest 11import sys 12import tempfile 13import unittest 14 15import exe_util 16 17 18class ExeUtilTests(fake_filesystem_unittest.TestCase): 19 def test_run_and_tee_output(self): 20 # Test wrapping Python as it echos a '.' character back. 21 args = [sys.executable, '-c', 'print(\'.\')'] 22 output = exe_util.run_and_tee_output(args) 23 self.assertEqual('.', output.strip()) 24