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

Unified Diff: Source/core/scripts/in_file_unittest.py

Issue 14696003: in_file.py should be able to parse "in" files (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 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
Index: Source/core/scripts/in_file_unittest.py
diff --git a/Source/core/scripts/in_file_unittest.py b/Source/core/scripts/in_file_unittest.py
index 7b3b038cf6d173894e43d1f67378fd285f107a7e..e065d442987150afe98b0910ff3a814f53e5fbae 100644
--- a/Source/core/scripts/in_file_unittest.py
+++ b/Source/core/scripts/in_file_unittest.py
@@ -42,12 +42,36 @@ name2
'arg': None,
'arg2': [],
}
- in_file = InFile(lines, defaults)
+ in_file = InFile(lines, defaults, None)
expected_values = [
{'name': 'name1', 'arg': 'value', 'arg2': ['value2', 'value3']},
{'name': 'name2', 'arg': None, 'arg2': []},
]
self.assertEquals(in_file.name_dictionaries, expected_values)
+ def test_with_parameters(self):
+ contents = """namespace=TestNamespace
eseidel 2013/04/30 21:46:16 Yes, requiring no leading newline is making your t
abarth-chromium 2013/04/30 21:50:44 Actually, it looks like the Perl support leading b
+fruit
+
+name1 arg=value, arg2=value2, arg2=value3
+name2
+"""
+ lines = contents.split("\n")
+ defaults = {
+ 'arg': None,
+ 'arg2': [],
+ }
+ default_parameters = {
+ 'namespace': '',
+ 'fruit': False,
+ }
+ in_file = InFile(lines, defaults, default_parameters)
+ expected_parameters = {
+ 'namespace': 'TestNamespace',
+ 'fruit': True,
+ }
+ self.assertEquals(in_file.parameters, expected_parameters)
+
+
if __name__ == "__main__":
unittest.main()

Powered by Google App Engine
This is Rietveld 408576698