blob: 1f83ac8c0e58c45f4b87416474ab45770f75b049 [file] [log] [blame]
# Copyright 2021 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from pyfakefs import fake_filesystem_unittest # pylint: disable=import-error
from flake_suppressor_common import queries
def CreateFile(test: fake_filesystem_unittest.TestCase, *args,
**kwargs) -> None:
# TODO(crbug.com/1156806): Remove this and just use fs.create_file() when
# Catapult is updated to a newer version of pyfakefs that is compatible with
# Chromium's version.
if hasattr(test.fs, 'create_file'):
test.fs.create_file(*args, **kwargs)
else:
test.fs.CreateFile(*args, **kwargs)
class FakeProcess():
def __init__(self, stdout: str):
self.stdout = stdout or ''
class UnitTest_BigQueryQuerier(queries.BigQueryQuerier):
def GetResultCountCIQuery(self) -> str:
return """SELECT * FROM foo"""
def GetResultCountTryQuery(self) -> str:
return """submitted_builds SELECT * FROM bar"""