summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Node/FSTests.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/SCons/Node/FSTests.py')
-rw-r--r--src/engine/SCons/Node/FSTests.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py
index 6bee431..4501cf1 100644
--- a/src/engine/SCons/Node/FSTests.py
+++ b/src/engine/SCons/Node/FSTests.py
@@ -1368,6 +1368,29 @@ class find_fileTestCase(unittest.TestCase):
assert os.path.normpath('./bar/baz') in file_names, file_names
assert os.path.normpath('./pseudo') in file_names, file_names
+ import StringIO
+ save_sys_stdout = sys.stdout
+
+ try:
+ sio = StringIO.StringIO()
+ sys.stdout = sio
+ SCons.Node.FS.find_file('foo', paths, fs.File, verbose="xyz")
+ expect = " xyz: looking for 'foo' in '.' ...\n" + \
+ " xyz: ... FOUND 'foo' in '.'\n"
+ c = sio.getvalue()
+ assert c == expect, c
+
+ sio = StringIO.StringIO()
+ sys.stdout = sio
+ SCons.Node.FS.find_file('baz', paths, fs.File, verbose=1)
+ expect = " find_file: looking for 'baz' in '.' ...\n" + \
+ " find_file: looking for 'baz' in 'bar' ...\n" + \
+ " find_file: ... FOUND 'baz' in 'bar'\n"
+ c = sio.getvalue()
+ assert c == expect, c
+ finally:
+ sys.stdout = save_sys_stdout
+
class StringDirTestCase(unittest.TestCase):
def runTest(self):
"""Test using a string as the second argument of