Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Unified Diff: tko/parsers/version_0_unittest.py

Issue 3713002: tko/parsers: make status_line parsing more robust to bad inputs (Closed) Base URL: http://git.chromium.org/git/autotest.git
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tko/parsers/version_0.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tko/parsers/version_0_unittest.py
diff --git a/tko/parsers/version_0_unittest.py b/tko/parsers/version_0_unittest.py
index 4807beecb67d0283844a458ece68a1b420ccc96a..ddcfd09dd18d4870dbe3c72257521ab537816e30 100755
--- a/tko/parsers/version_0_unittest.py
+++ b/tko/parsers/version_0_unittest.py
@@ -216,7 +216,7 @@ class test_status_line(unittest.TestCase):
def test_parse_line_handles_newline(self):
input_data = ("\t\tGOOD\t----\t----\t"
"field1=val1\tfield2=val2\tNo newline here!")
- for suffix in ("", "\n"):
+ for suffix in ("", "\n", "\n\n"):
line = version_0.status_line.parse_line(input_data +
suffix)
self.assertEquals(line.indent, 2)
@@ -261,9 +261,8 @@ class test_status_line(unittest.TestCase):
def test_parse_line_fails_on_bad_optional_fields(self):
input_data = "GOOD\tfield1\tfield2\tfield3\tfield4"
- self.assertRaises(AssertionError,
- version_0.status_line.parse_line,
- input_data)
+ self.assertEquals(None,
+ version_0.status_line.parse_line(input_data))
if __name__ == "__main__":
« no previous file with comments | « tko/parsers/version_0.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698