|
|
@ -3,9 +3,9 @@
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
import unittest
|
|
|
|
import unittest
|
|
|
|
|
|
|
|
|
|
|
|
from pubs.p3 import ustr
|
|
|
|
|
|
|
|
from pubs.utils import standardize_doi
|
|
|
|
from pubs.utils import standardize_doi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TestDOIStandardization(unittest.TestCase):
|
|
|
|
class TestDOIStandardization(unittest.TestCase):
|
|
|
|
|
|
|
|
|
|
|
|
def setUp(self):
|
|
|
|
def setUp(self):
|
|
|
@ -59,7 +59,7 @@ class TestDOIStandardization(unittest.TestCase):
|
|
|
|
sdoi = standardize_doi(doi)
|
|
|
|
sdoi = standardize_doi(doi)
|
|
|
|
self.assertEqual(sdoi, '10.1109/5.771073')
|
|
|
|
self.assertEqual(sdoi, '10.1109/5.771073')
|
|
|
|
|
|
|
|
|
|
|
|
def test_doi_colon_org(self):
|
|
|
|
def test_doi_colon(self):
|
|
|
|
doi = 'doi:10.1109/5.771073'
|
|
|
|
doi = 'doi:10.1109/5.771073'
|
|
|
|
sdoi = standardize_doi(doi)
|
|
|
|
sdoi = standardize_doi(doi)
|
|
|
|
self.assertEqual(sdoi, '10.1109/5.771073')
|
|
|
|
self.assertEqual(sdoi, '10.1109/5.771073')
|
|
|
@ -76,5 +76,5 @@ class TestDOIStandardization(unittest.TestCase):
|
|
|
|
|
|
|
|
|
|
|
|
def test_currently_not_supported(self):
|
|
|
|
def test_currently_not_supported(self):
|
|
|
|
for doi in self.currently_not_supported:
|
|
|
|
for doi in self.currently_not_supported:
|
|
|
|
sdoi = standardize_doi(doi)
|
|
|
|
with self.assertRaises(ValueError):
|
|
|
|
self.assertIs(sdoi, None)
|
|
|
|
standardize_doi(doi)
|
|
|
|