def _LoadIdlAPI(self, api): idl = idl_parser.IDLParser().ParseData(api) generator = HandlebarDictGenerator( idl_schema.IDLSchema(idl).process()[0]) return generator.Generate()
def _LoadJsonAPI(self, api): generator = HandlebarDictGenerator( json.loads(json_comment_eater.Nom(api), object_pairs_hook=collections.OrderedDict)[0]) return generator.Generate()
def _GenerateTest(self, filename): expected_json = json.loads(self._ReadLocalFile('expected_' + filename)) gen = HandlebarDictGenerator(self._LoadJSON(filename)) self.assertEquals(expected_json, gen.Generate())
def _LoadJsonAPI(self, api): generator = HandlebarDictGenerator( json.loads(json_comment_eater.Nom(api))[0]) return generator.Generate()
def _GenerateTest(self, filename): expected_json = json.loads(self._ReadLocalFile('expected_' + filename)) gen = HandlebarDictGenerator( json.loads(comment_eater.Nom(self._ReadLocalFile(filename)))[0]) self.assertEquals(expected_json, gen.Generate())