예제 #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)
예제 #2
0
파일: core.py 프로젝트: timofurrer/ramlient
    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)
예제 #3
0
def parsed_raml(string):
    return ramlfications.parse_raml(ramlfications.loads(string),
                                    ramlfications.setup_config(None))
예제 #4
0
def test_loads(raml_string):
    result = loads(raml_string)
    assert result
    assert isinstance(result, dict)