Пример #1
0
    def test_06_request_wiki_page(self):
        """ 6: Test if wiki page for this Resource exists """
        import wikitools
        import config

        resource = Resource(self.testid)
        resource.wiki_site = wikitools.Wiki(config.wiki_api_url)
        resource.wiki_site.login(config.wiki_username, password=config.wiki_password)

        wiki_page = resource._request_wiki_page()
        self.failUnless(wiki_page, "Wiki page does not exist or empty!")
Пример #2
0
    def test_07_extract_csv_configurations(self):
        """ 7: Test the parser for CSV configurations on Wiki page """
        import wikitools
        import config

        resource = Resource(self.testid)
        resource.wiki_site = wikitools.Wiki(config.wiki_api_url)
        resource.wiki_site.login(config.wiki_username, password=config.wiki_password)

        wiki_page = resource._request_wiki_page()
        mappings = resource._extract_csv_mappings(wiki_page)
        for mapping in mappings:
            self.failUnless(mapping["type"] == "RelCSV2RDF", "Wrong mapping type, should be RelCSV2RDF.")
            self.failUnless(mapping["name"], "Name of mapping is undefined!")
            self.failUnless(mapping["header"], "Header line is not specified")
            self.failUnless(mapping["omitCols"], "omitCols is not specified")
            self.failUnless(mapping["omitRows"], "omitRows is not specified")