Index: chrome/common/extensions/docs/server2/intro_data_source_test.py |
diff --git a/chrome/common/extensions/docs/server2/intro_data_source_test.py b/chrome/common/extensions/docs/server2/intro_data_source_test.py |
index 7e8e8942e5d17c0a8b6f82a7a777f8b6e8cc8eeb..51f09d9fbecc5d98e304695bde4208d7e9425182 100755 |
--- a/chrome/common/extensions/docs/server2/intro_data_source_test.py |
+++ b/chrome/common/extensions/docs/server2/intro_data_source_test.py |
@@ -3,23 +3,27 @@ |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
+import json |
+import os |
+ |
from server_instance import ServerInstance |
-import svn_constants |
+from test_data.canned_data import CANNED_TEST_FILE_SYSTEM_DATA |
from test_file_system import TestFileSystem |
import unittest |
-_TEST_DATA = TestFileSystem.MoveTo(svn_constants.INTRO_PATH, { |
- 'test.html': '<h1>hello</h1>world<h2>first</h2><h3>inner</h3><h2>second</h2>' |
-}) |
+def _LoadJson(name, mode='rb'): |
+ return json.load( |
+ open(os.path.join('test_data', 'test_json', name), mode)) |
class IntroDataSourceTest(unittest.TestCase): |
def setUp(self): |
- self._server = ServerInstance.ForTest(TestFileSystem(_TEST_DATA)) |
+ self._server = ServerInstance.ForTest( |
+ TestFileSystem(CANNED_TEST_FILE_SYSTEM_DATA)) |
def testIntro(self): |
intro_data_source = self._server.intro_data_source_factory.Create() |
data = intro_data_source.get('test') |
- self.assertEqual('hello', data['title']) |
+ self.assertEqual('hi', data['title']) |
# TODO(kalman): test links. |
expected_toc = [{'subheadings': [{'link': '', 'title': u'inner'}], |
'link': '', |
@@ -27,7 +31,7 @@ class IntroDataSourceTest(unittest.TestCase): |
{'subheadings': [], 'link': '', 'title': u'second'}] |
self.assertEqual(expected_toc, data['apps_toc']) |
self.assertEqual(expected_toc, data['extensions_toc']) |
- self.assertEqual('world<h2>first</h2><h3>inner</h3><h2>second</h2>', |
+ self.assertEqual('you<h2>first</h2><h3>inner</h3><h2>second</h2>', |
data['intro'].render().text) |
if __name__ == '__main__': |