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

Unified Diff: tko/parsers/version_0_unittest.py

Issue 3885001: Change Autotest status parser from fail-hard to fail-safe. (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 abf7b676309566d837a5577e57e8ec11292ff5ae..286e5bb2f735e5e904095def00678c540cd55125 100755
--- a/tko/parsers/version_0_unittest.py
+++ b/tko/parsers/version_0_unittest.py
@@ -273,11 +273,19 @@ class test_status_line(unittest.TestCase):
self.assertEquals(line.optional_fields, {})
- 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)
+ def test_parse_line_handles_tabs_in_reason(self):
+ input_data = ("\tEND FAIL\t----\ttest\tfield1=val1\tfield2=val2\tReason"
+ " with\ta\tcouple\ttabs")
+
+ line = version_0.status_line.parse_line(input_data)
+ self.assertEquals(line.indent, 1)
+ self.assertEquals(line.type, "END")
+ self.assertEquals(line.status, "FAIL")
+ self.assertEquals(line.subdir, None)
+ self.assertEquals(line.testname, "test")
+ self.assertEquals(line.reason, "Reason with\ta\tcouple\ttabs")
+ self.assertEquals(line.optional_fields, {"field1": "val1",
+ "field2": "val2"})
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