Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import unittest | 6 import unittest |
| 7 | 7 |
| 8 from document_renderer import DocumentRenderer | 8 from document_renderer import DocumentRenderer |
| 9 from server_instance import ServerInstance | 9 from server_instance import ServerInstance |
| 10 from test_file_system import TestFileSystem | 10 from test_file_system import TestFileSystem |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 109 | 109 |
| 110 text, warnings = self._renderer.Render(document, path) | 110 text, warnings = self._renderer.Render(document, path) |
| 111 self.assertEqual(expected_document, text) | 111 self.assertEqual(expected_document, text) |
| 112 self.assertEqual([], warnings) | 112 self.assertEqual([], warnings) |
| 113 | 113 |
| 114 text, warnings = self._renderer.Render(document, path, render_title=True) | 114 text, warnings = self._renderer.Render(document, path, render_title=True) |
| 115 self.assertEqual(expected_document, text) | 115 self.assertEqual(expected_document, text) |
| 116 self.assertEqual(['Expected a title'], warnings) | 116 self.assertEqual(['Expected a title'], warnings) |
| 117 | 117 |
| 118 def testInvalidRef(self): | 118 def testInvalidRef(self): |
| 119 # There needs to be more than 100 characters between the invalid ref | 119 # There needs to be more than 110 characters between the invalid ref |
|
ahernandez
2014/03/28 19:04:52
WDYT about changing this comment to be a bit more
not at google - send to devlin
2014/03/28 21:48:22
sgtm
ahernandez
2014/03/28 22:03:25
Do you have any suggestions? I was having trouble
not at google - send to devlin
2014/03/28 22:08:44
Sure, how about, "DocumentRenderer attempts to det
| |
| 120 # and the next ref | 120 # and the next ref |
| 121 document = ('An invalid $(ref:foo.foo_t3 a title with some long ' | 121 document = ('An invalid $(ref:foo.foo_t3 a title with some long ' |
| 122 'text containing a valid reference pointing to ' | 122 'text containing a valid reference pointing to a thing called ' |
| 123 '$(ref:baz.baz_e1) here') | 123 '$(ref:baz.baz_e1) here') |
| 124 expected_document = ('An invalid $(ref:foo.foo_t3 a title with some long ' | 124 expected_document = ('An invalid $(ref:foo.foo_t3 a title with some long ' |
| 125 'text containing a valid reference pointing to <a' | 125 'text containing a valid reference pointing to a ' |
| 126 ' href=#type-baz_e1>baz.baz_e1</a> here') | 126 'thing called <a href=#type-baz_e1>baz.baz_e1</a> ' |
| 127 'here') | |
| 127 path = 'some/path/to/document_api.html' | 128 path = 'some/path/to/document_api.html' |
| 128 | 129 |
| 129 text, warnings = self._renderer.Render(document, path) | 130 text, warnings = self._renderer.Render(document, path) |
| 130 self.assertEqual(expected_document, text) | 131 self.assertEqual(expected_document, text) |
| 131 self.assertEqual([], warnings) | 132 self.assertEqual([], warnings) |
| 132 | 133 |
| 133 text, warnings = self._renderer.Render(document, path, render_title=True) | 134 text, warnings = self._renderer.Render(document, path, render_title=True) |
| 134 self.assertEqual(expected_document, text) | 135 self.assertEqual(expected_document, text) |
| 135 self.assertEqual(['Expected a title'], warnings) | 136 self.assertEqual(['Expected a title'], warnings) |
| 136 | 137 |
| 137 | 138 |
| 138 if __name__ == '__main__': | 139 if __name__ == '__main__': |
| 139 unittest.main() | 140 unittest.main() |
| OLD | NEW |