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

Unified Diff: chrome/common/extensions/docs/server2/intro_data_source_test.py

Issue 12996003: Dynamically generate a heading for Extension Docs API pages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor changes 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 side-by-side diff with in-line comments
Download patch
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 90f2c76de4c146147104d2176c17b6d2c475e42b..45f5c242d45551ac62324be661e1abc4442611e5 100755
--- a/chrome/common/extensions/docs/server2/intro_data_source_test.py
+++ b/chrome/common/extensions/docs/server2/intro_data_source_test.py
@@ -4,13 +4,26 @@
# found in the LICENSE file.
from server_instance import ServerInstance
-import svn_constants
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>'
-})
+_TEST_DATA = {
+ 'api': {
+ '_manifest_features.json': '{"manifest": "features"}',
+ '_permission_features.json': '{"permission": "features"}'
+ },
+ 'docs': {
+ 'templates': {
+ 'intros': {
+ 'test.html': '<h1>hi</h1>you<h2>first</h2><h3>inner</h3><h2>second</h2>'
+ },
+ 'json': {
+ 'api_availabilities.json': '[{"name": "test", "availability": "none"}]',
+ 'intro_tables.json': '{"test": [{"Permissions": "blue"}]}'
+ }
+ }
+ }
+}
class IntroDataSourceTest(unittest.TestCase):
def setUp(self):
@@ -19,7 +32,7 @@ class IntroDataSourceTest(unittest.TestCase):
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 +40,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__':

Powered by Google App Engine
This is Rietveld 408576698