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

Side by Side Diff: chrome/common/extensions/docs/server2/reference_resolver_test.py

Issue 80183002: Correct $ref links in extensions documentation server relative location. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Feedback Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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 json 6 import json
7 import os 7 import os
8 import sys 8 import sys
9 import unittest 9 import unittest
10 10
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 '<pre><a href="bar.html#type-bon">bar.bon</a>({\nkey: value})', 163 '<pre><a href="bar.html#type-bon">bar.bon</a>({\nkey: value})',
164 resolver.ResolveAllLinks('<pre>$ref:[bar.bon]({\nkey: value})', 164 resolver.ResolveAllLinks('<pre>$ref:[bar.bon]({\nkey: value})',
165 namespace='baz')) 165 namespace='baz'))
166 166
167 # Allow bare "$ref:foo.bar." at the end of a string. 167 # Allow bare "$ref:foo.bar." at the end of a string.
168 self.assertEqual( 168 self.assertEqual(
169 '<a href="bar.html#type-bon">bar.bon</a>.', 169 '<a href="bar.html#type-bon">bar.bon</a>.',
170 resolver.ResolveAllLinks('$ref:bar.bon.', 170 resolver.ResolveAllLinks('$ref:bar.bon.',
171 namespace='baz')) 171 namespace='baz'))
172 172
173 # If a request is provided it should construct an appropriate relative link.
174 self.assertEqual(
175 'Hi <a href="../../bar.bon.html#property-bar_bon_p3">bar_bon_p3</a>, '
176 '<a href="../../bar.bon.html#property-bar_bon_p3">Bon Bon</a>, '
177 '<a href="../../bar.bon.html#property-bar_bon_p3">bar_bon_p3</a>',
178 resolver.ResolveAllLinks(
179 'Hi $ref:bar_bon_p3, $ref:[bar_bon_p3 Bon Bon], $ref:bar_bon_p3',
180 relative_to='big/long/path/bar.html',
181 namespace='bar.bon'))
not at google - send to devlin 2013/11/27 21:46:09 you might also want to test relative_to of '', 'fo
benwells 2013/12/02 06:32:32 Done.
182
173 if __name__ == '__main__': 183 if __name__ == '__main__':
174 unittest.main() 184 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698