def parse_raml(self): """ Parse RAML file """ if utils.is_url(self.ramlfile): raml = utils.download_file(self.ramlfile) else: with codecs.open(self.ramlfile, "rb", encoding="utf-8") as raml_f: raml = raml_f.read() loader = ramlfications.loads(raml) config = ramlfications.setup_config(None) self.raml = ramlfications.parse_raml(loader, config)
def parsed_raml(string): return ramlfications.parse_raml(ramlfications.loads(string), ramlfications.setup_config(None))
def test_loads(raml_string): result = loads(raml_string) assert result assert isinstance(result, dict)