Esempio n. 1
0
    def _extract_aliases(self, page, id=None):
        dict_of_keylists = {'url': ['url']}

        aliases_dict = provider._extract_from_xml(page, dict_of_keylists)

        try:
            doi = provider.doi_from_url_string(aliases_dict["url"])
            if doi:
                aliases_dict["doi"] = doi
        except KeyError:
            pass

        if aliases_dict:
            aliases_list = [(namespace, nid)
                            for (namespace, nid) in aliases_dict.iteritems()]
        else:
            aliases_list = []
        return aliases_list
Esempio n. 2
0
    def _extract_aliases(self, page, id=None):
        dict_of_keylists = {
            'url' : ['url']
        }

        aliases_dict = provider._extract_from_xml(page, dict_of_keylists)

        try:
            doi = provider.doi_from_url_string(aliases_dict["url"])
            if doi:
                aliases_dict["doi"] = doi
        except KeyError:
            pass

        if aliases_dict:
            aliases_list = [(namespace, nid) for (namespace, nid) in aliases_dict.iteritems()]
        else:
            aliases_list = []
        return aliases_list
Esempio n. 3
0
 def test_doi_from_url_string(self):
     test_url = "https://knb.ecoinformatics.org/knb/d1/mn/v1/object/doi:10.5063%2FAA%2Fnrs.373.1"
     expected = "10.5063/AA/nrs.373.1"
     response = provider.doi_from_url_string(test_url)
     assert_equals(response, expected)
Esempio n. 4
0
 def test_doi_from_url_string(self):
     test_url = "https://knb.ecoinformatics.org/knb/d1/mn/v1/object/doi:10.5063%2FAA%2Fnrs.373.1"
     expected = "10.5063/AA/nrs.373.1"
     response = provider.doi_from_url_string(test_url)
     assert_equals(response, expected)