Test files added

See https://github.com/Phyks/BMC/issues/7.
This commit is contained in:
Phyks 2014-06-29 20:35:22 +02:00
parent 3ed4d82307
commit 2e7369e14e
10 changed files with 42 additions and 4 deletions

View File

@ -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.

View File

@ -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

21
tests/src/arxiv.bib Normal file
View File

@ -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},
}

12
tests/src/doi.bib Normal file
View File

@ -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}
}

BIN
tests/src/test.djvu Normal file

Binary file not shown.

BIN
tests/src/test.pdf Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
tests/src/test_hal.pdf Normal file

Binary file not shown.

View File

@ -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"))