diff --git a/README.md b/README.md index 48991c9..fac5011 100644 --- a/README.md +++ b/README.md @@ -154,3 +154,7 @@ A list of ideas and TODO. Don't hesitate to give feedback on the ones you really * Nathan Grigg for his [arxiv2bib](https://pypi.python.org/pypi/arxiv2bib/1.0.5#downloads) python module * François Boulogne for his [python-bibtexparser](https://github.com/sciunto/python-bibtexparser) python module and his integration of new requested features * pyparsing [search parser example](http://pyparsing.wikispaces.com/file/view/searchparser.py) + +## Note on test files + +* The test files used, provided in `tests/src` are under CC-BY license, from arXiv, HAL and PhysRev. diff --git a/fetcher.py b/fetcher.py index 2371e97..18fa442 100644 --- a/fetcher.py +++ b/fetcher.py @@ -146,7 +146,7 @@ def findDOI(src): extractfull = '' while totext.poll() is None: - extractfull += totext.stdout.readline().strip() + extractfull += "".join([i.strip() for i in totext.stdout.readlines()]) extractDOI = doi_re.search(extractfull.lower().replace('Œ', '-')) if not extractDOI: # PNAS fix diff --git a/tests/src/arxiv.bib b/tests/src/arxiv.bib new file mode 100644 index 0000000..073ab5a --- /dev/null +++ b/tests/src/arxiv.bib @@ -0,0 +1,21 @@ +@article{1303.3130v1, + abstract={We study the role of the dipolar interaction, correctly accounting for the +Dipolar-Induced Resonance (DIR), in a quasi-one-dimensional system of ultracold +bosons. We first show how the DIR affects the lowest-energy states of two +particles in a harmonic trap. Then, we consider a deep optical lattice loaded +with ultracold dipolar bosons. We describe this many-body system using an +atom-dimer extended Bose-Hubbard model. We analyze the impact of the DIR on the +phase diagram at T=0 by exact diagonalization of a small-sized system. In +particular, the resonance strongly modifies the range of parameters for which a +mass density wave should occur.}, + archiveprefix={arXiv}, + author={N. Bartolo and D. J. Papoular and L. Barbiero and C. Menotti and A. Recati}, + eprint={1303.3130v1}, + link={http://arxiv.org/abs/1303.3130v1}, + month={Mar}, + primaryclass={cond-mat.quant-gas}, + title={Dipolar-Induced Resonance for Ultracold Bosons in a Quasi-1D Optical +Lattice}, + year={2013}, +} + diff --git a/tests/src/doi.bib b/tests/src/doi.bib new file mode 100644 index 0000000..873faa2 --- /dev/null +++ b/tests/src/doi.bib @@ -0,0 +1,12 @@ +@article{Hou_2013, + doi = {10.1103/physreva.88.043630}, + url = {http://dx.doi.org/10.1103/physreva.88.043630}, + year = 2013, + month = {Oct}, + publisher = {American Physical Society (APS)}, + volume = {88}, + number = {4}, + author = {Yan-Hua Hou and Lev P. Pitaevskii and Sandro Stringari}, + title = {First and second sound in a highly elongated Fermi gas at unitarity}, + journal = {Physical Review A} +} \ No newline at end of file diff --git a/tests/src/test.djvu b/tests/src/test.djvu new file mode 100644 index 0000000..7d30dcc Binary files /dev/null and b/tests/src/test.djvu differ diff --git a/tests/src/test.pdf b/tests/src/test.pdf new file mode 100644 index 0000000..1493948 Binary files /dev/null and b/tests/src/test.pdf differ diff --git a/tests/src/test_arxiv_multi.pdf b/tests/src/test_arxiv_multi.pdf new file mode 100644 index 0000000..33fcd9a Binary files /dev/null and b/tests/src/test_arxiv_multi.pdf differ diff --git a/tests/src/test_arxiv_published.pdf b/tests/src/test_arxiv_published.pdf new file mode 100644 index 0000000..d27250d Binary files /dev/null and b/tests/src/test_arxiv_published.pdf differ diff --git a/tests/src/test_hal.pdf b/tests/src/test_hal.pdf new file mode 100644 index 0000000..65289f7 Binary files /dev/null and b/tests/src/test_hal.pdf differ diff --git a/tests/test_fetcher.py b/tests/test_fetcher.py index 77cfce0..972007a 100644 --- a/tests/test_fetcher.py +++ b/tests/test_fetcher.py @@ -46,15 +46,16 @@ class TestFetcher(unittest.TestCase): self.assertEqual(isbn2Bib('0198507194'), self.isbn_bib) def test_isbn2Bib_False(self): - self.assertEqual(isbn2Bib('blabla'), '') + self.assertEqual(isbn2Bib('foo'), '') def test_findDOI_PDF(self): self.assertEqual(findDOI("tests/src/test.pdf"), - '10.1103/physreva.88.043630') + "10.1103/physrevlett.112.253201") def test_findDOI_DJVU(self): + # DOI is incomplete in this text because my djvu file is bad self.assertEqual(findDOI("tests/src/test.djvu"), - '10.1103/physreva.88.043630') + "10.1103/physrevlett.112") def test_findDOI_False(self): self.assertFalse(findDOI("tests/src/test_arxiv_multi.pdf"))