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

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

Issue 13470005: Refactor the devserver to make it easier to control caching (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cduvall, rebase 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 #!/usr/bin/env python
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
4 # found in the LICENSE file.
5
6 from server_instance import ServerInstance
7 import svn_constants
8 from test_file_system import TestFileSystem
9 import unittest
10
11 _TEST_DATA = TestFileSystem.MoveTo(svn_constants.INTRO_PATH, {
12 'test.html': '<h1>hello</h1>world<h2>first</h2><h3>inner</h3><h2>second</h2>'
13 })
14
15 class IntroDataSourceTest(unittest.TestCase):
16 def setUp(self):
17 self._server = ServerInstance.CreateForTest(TestFileSystem(_TEST_DATA))
18
19 def testIntro(self):
20 intro_data_source = self._server.intro_data_source_factory.Create()
21 data = intro_data_source.get('test')
22 self.assertEqual('hello', data['title'])
23 # TODO(kalman): test links.
24 expected_toc = [{'subheadings': [{'link': '', 'title': u'inner'}],
25 'link': '',
26 'title': u'first'},
27 {'subheadings': [], 'link': '', 'title': u'second'}]
28 self.assertEqual(expected_toc, data['apps_toc'])
29 self.assertEqual(expected_toc, data['extensions_toc'])
30 self.assertEqual('world<h2>first</h2><h3>inner</h3><h2>second</h2>',
31 data['intro'].render().text)
32
33 if __name__ == '__main__':
34 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698