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

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

Issue 16410002: Docserver manifest follow up (rewrite) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gen-manifest-try-2
Patch Set: replace dictionaries with Feature class Created 7 years, 5 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/features_model_test.py
diff --git a/chrome/common/extensions/docs/server2/features_model_test.py b/chrome/common/extensions/docs/server2/features_model_test.py
index 80fb6620bb111694837991803005ec3c51780875..8a7335888f5fa7fcb45426d49194c69646768f64 100755
--- a/chrome/common/extensions/docs/server2/features_model_test.py
+++ b/chrome/common/extensions/docs/server2/features_model_test.py
@@ -6,7 +6,7 @@
from copy import deepcopy
import unittest
-from features_model import FeaturesModel
+from features_model import FeaturesModel, Feature
raw_features_json = {
'doc1': {
@@ -37,26 +37,26 @@ raw_features_json = {
class FeaturesUtilityTest(unittest.TestCase):
def testFeatureFile(self):
init_json = {
- 'doc1': {
+ 'doc1': Feature({
'platform': ['extension', 'app'],
'name': 'doc1'
- },
- 'doc2': {
+ }),
+ 'doc2': Feature({
'platform': [],
'name': 'doc2'
- },
- 'doc4': {
+ }),
+ 'doc4': Feature({
'platform': ['extension', 'app'],
'name': 'doc4'
- },
- 'doc5': {
+ }),
+ 'doc5': Feature({
'platform': ['extension'],
'name': 'doc5'
- },
- 'doc1.sub1': {
+ }),
+ 'doc1.sub1': Feature({
'platform': ['app'],
'name': 'doc1.sub1'
- }
+ })
}
features_model = FeaturesModel().FromJson(raw_features_json)
@@ -79,12 +79,12 @@ class FeaturesUtilityTest(unittest.TestCase):
}
expected_merge_result = {
- 'doc1': {
+ 'doc1': Feature({
'documentation': 'http://documentation',
'platform': ['extension', 'app'],
'name': 'doc1'
- },
- 'doc2': {
+ }),
+ 'doc2': Feature({
'platform': [],
'name': 'doc2',
'children': {
@@ -92,40 +92,40 @@ class FeaturesUtilityTest(unittest.TestCase):
'name': 'sub'
}
}
- },
- 'doc4': {
+ }),
+ 'doc4': Feature({
'platform': ['extension', 'app'],
'name': 'doc4'
- },
- 'doc5': {
+ }),
+ 'doc5': Feature({
'platform': ['extension'],
'name': 'doc5',
'example': {}
- },
- 'doc1.sub1': {
+ }),
+ 'doc1.sub1': Feature({
'platform': ['app'],
'name': 'doc1.sub1'
- }
+ })
}
features_model = features_model.MergeWith(additional_dict)
self.assertEqual(expected_merge_result, features_model.Get())
expected_filter = {
- 'doc1': {
+ 'doc1': Feature({
'documentation': 'http://documentation',
'platform': ['extension', 'app'],
'name': 'doc1'
- },
- 'doc4': {
+ }),
+ 'doc4': Feature({
'platform': ['extension', 'app'],
'name': 'doc4'
- },
- 'doc5': {
+ }),
+ 'doc5': Feature({
'platform': ['extension'],
'name': 'doc5',
'example': {}
- }
+ })
}
self.assertEqual(

Powered by Google App Engine
This is Rietveld 408576698