def render_apib(self, apib_file):
        pathname_ = path.dirname(path.abspath(__file__))
        self.apib_file = pathname_ + "/" + apib_file + ".apib"
        self.tmp_result_files = "/var/tmp/test-links-in-reference-160faf1aae1dd41c8f16746ea744f138"

        self.html_output = self.tmp_result_files + "/" + apib_file + ".html"

        if os.path.exists(self.tmp_result_files):
            shutil.rmtree(self.tmp_result_files)

        os.makedirs(self.tmp_result_files)

        main([
            "fabre", "-i", self.apib_file, "-o", self.tmp_result_files,
            "--no-clear-temp-dir"
        ])

        parser = etree.HTMLParser()
        self.tree = etree.parse(
            "" + self.tmp_result_files + "/" + apib_file + ".html", parser)
        self.pq = pq(filename=self.tmp_result_files + "/" + apib_file +
                     ".html")

        with open(
                '/var/tmp/fiware_api_blueprint_renderer_tmp/' + apib_file +
                '.json', 'r') as f:
            self.out_json = json.load(f)
Example #2
0
    def setUpClass(cls):
        pathname_ = path.dirname(path.abspath(__file__))
        cls.apib_file = pathname_ + "/api_test.apib"
        cls.tmp_result_files = "/var/tmp/test-links-in-reference-160faf1aae1dd41c8f16746ea744f138"

        cls.html_output = cls.tmp_result_files + "api_test.html"

        if os.path.exists(cls.tmp_result_files):
            shutil.rmtree(cls.tmp_result_files)

        os.makedirs(cls.tmp_result_files)

        main([
            "fabre", "-i", cls.apib_file, "-o", cls.tmp_result_files,
            "--no-clear-temp-dir"
        ])

        parser = etree.HTMLParser()
        cls.tree = etree.parse("" + cls.tmp_result_files + "/api_test.html",
                               parser)
        cls.pq = pq(filename=cls.tmp_result_files + "/api_test.html")

        with open('/var/tmp/fiware_api_blueprint_renderer_tmp/api_test.json',
                  'r') as f:
            cls.out_json = json.load(f)
    def setUpClass(cls):
        pathname_ = path.dirname(path.abspath(__file__))
        cls.apib_file = pathname_+"/api_test.apib"
        cls.tmp_result_files = "/var/tmp/test-links-in-reference-160faf1aae1dd41c8f16746ea744f138"

        cls.html_output = cls.tmp_result_files+"api_test.html"

        if os.path.exists(cls.tmp_result_files):
            shutil.rmtree(cls.tmp_result_files)

        os.makedirs(cls.tmp_result_files)

        main(["fabre", "-i", cls.apib_file, "-o", 
             cls.tmp_result_files, "--no-clear-temp-dir"])

        parser = etree.HTMLParser()
        cls.tree = etree.parse(""+cls.tmp_result_files+"/api_test.html", parser)
        cls.pq = pq(filename = cls.tmp_result_files+"/api_test.html")

        with open('/var/tmp/fiware_api_blueprint_renderer_tmp/api_test.json', 'r') as f:
            cls.out_json = json.load(f)
    def render_apib(self,apib_file):
        pathname_ = path.dirname(path.abspath(__file__))
        self.apib_file = pathname_+"/"+apib_file+".apib"
        self.tmp_result_files = "/var/tmp/test-links-in-reference-160faf1aae1dd41c8f16746ea744f138"

        self.html_output = self.tmp_result_files+"/"+apib_file+".html"

        if os.path.exists(self.tmp_result_files):
            shutil.rmtree(self.tmp_result_files)

        os.makedirs(self.tmp_result_files)

        main(["fabre", "-i", self.apib_file, "-o", 
             self.tmp_result_files, "--no-clear-temp-dir"])
        

        parser = etree.HTMLParser()
        self.tree = etree.parse(""+self.tmp_result_files+"/"+apib_file+".html", parser)
        self.pq = pq(filename = self.tmp_result_files+"/"+apib_file+".html")

        with open('/var/tmp/fiware_api_blueprint_renderer_tmp/'+apib_file+'.json', 'r') as f:
            self.out_json = json.load(f)