Wrap the rest of file reading operations inside a with block and convert a assertTrue()

usage to self.expect() which is more descriptive.

llvm-svn: 116115
This commit is contained in:
Johnny Chen 2010-10-08 22:10:42 +00:00
parent e6acf35582
commit 277c8f0f1d
2 changed files with 6 additions and 4 deletions

View File

@ -65,10 +65,11 @@ class BreakpointCommandTestCase(TestBase):
# Check that the file 'output.txt' exists and contains the string "lldb".
# Read the output file produced by running the program.
output = open('output.txt', 'r').read()
with open('output.txt', 'r') as f:
output = f.read()
self.assertTrue(output.startswith("lldb"),
"File 'output.txt' and the content matches")
self.expect(output, "File 'output.txt' and the content matches", exe=False,
startstr = "lldb")
# Finish the program.
self.runCmd("process continue")

View File

@ -70,7 +70,8 @@ class SettingsCommandTestCase(TestBase):
self.runCmd("run", RUN_SUCCEEDED)
# Read the output file produced by running the program.
output = open('output.txt', 'r').read()
with open('output.txt', 'r') as f:
output = f.read()
self.expect(output, exe=False,
substrs = ["argv[1] matches",