Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
    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)
Exemplo n.º 3
0
def parsed_raml(string):
    return ramlfications.parse_raml(ramlfications.loads(string),
                                    ramlfications.setup_config(None))
Exemplo n.º 4
0
def test_loads(raml_string):
    result = loads(raml_string)
    assert result
    assert isinstance(result, dict)