xref: /aosp_15_r20/external/cronet/testing/scripts/rust/exe_util_unittests.py (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
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