Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / common / extensions / docs / server2 / intro_data_source_test.py
blob3f5b3b11bddda634433d941a63d19aa1972d984b
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.
6 from intro_data_source import IntroDataSource
7 from server_instance import ServerInstance
8 from servlet import Request
9 from test_data.canned_data import CANNED_TEST_FILE_SYSTEM_DATA
10 from test_file_system import TestFileSystem
11 import unittest
13 class IntroDataSourceTest(unittest.TestCase):
14 def setUp(self):
15 self._server_instance = ServerInstance.ForTest(
16 TestFileSystem(CANNED_TEST_FILE_SYSTEM_DATA))
18 def testIntro(self):
19 intro_data_source = IntroDataSource(
20 self._server_instance, Request.ForTest(''))
21 intro_data = intro_data_source.get('test_intro')
22 article_data = intro_data_source.get('test_article')
24 expected_intro = 'you<h2>first</h2><h3>inner</h3><h2>second</h2>'
25 # Article still has the header.
26 expected_article = '<h1>hi</h1>' + expected_intro
28 self.assertEqual(expected_intro, intro_data.Render().text)
29 self.assertEqual(expected_article, article_data.Render().text)
32 if __name__ == '__main__':
33 unittest.main()