def test_query_doi_is_resolved_query_email(self): """ Testing the is_resolved method using an invalid email """ doi = Brocker(query_email='*****@*****.**') self.assertRaises(HTTPError, lambda: doi.is_resolved("10.1590/S2179-975X2012005000002"))
def test_doi_is_resolved_unresolved(self): """ Querying crossfer using a unregistered DOI number """ doi = Brocker() is_resolved = doi.is_resolved("10.1590/S2179-975X20120050XXXXX") self.assertEqual(is_resolved, False)
def test_query_doi_is_resolved_wrong_api_url(self): """ Testing the is_resolved method using an invalid url """ doi = Brocker(crossref_api_url='http://wrongurl.crossref.org/servlet/query') self.assertRaises(URLError, lambda: doi.is_resolved("10.1590/S2179-975X2012005000002"))