Closed GiorgosPa closed 10 years ago
There are some issues with the tests:
$ nosetests tests/
because of the fileopening causing IOError: [Errno 2] No such file or directory: 'sample_pos_record.xml'
when you are not placed in the same directory.Take a look at this suggestion, we can have the relative import and put the test-data in under tests/data
$ nosetests
..........................F....F.F........F...................................F....F.F........F.........
======================================================================
FAIL: test_journal (tests.edpsciencespackage_tests.EDPSciencesPackageTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jlavik/src/harvesting-kit/tests/edpsciencespackage_tests.py", line 58, in test_journal
self.assertEqual(self.edp._get_journal(), 'Astron.Astrophys.')
AssertionError: 'A&A' != 'Astron.Astrophys.'
======================================================================
FAIL: test_publication_information (tests.edpsciencespackage_tests.EDPSciencesPackageTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jlavik/src/harvesting-kit/tests/edpsciencespackage_tests.py", line 99, in test_publication_information
self.assertEqual(self.edp._get_publication_information(), publication_information)
AssertionError: Tuples differ: ('A&A', '565', '', '2014', '20... != ('Astron.Astrophys.', '565', '...
First differing element 0:
A&A
Astron.Astrophys.
- ('A&A',
+ ('Astron.Astrophys.',
'565',
'',
- '2014',
+ u'2014',
? +
'2014-05-23',
u'10.1051/0004-6361/201423985',
'L9',
'925',
'')
======================================================================
FAIL: test_references (tests.edpsciencespackage_tests.EDPSciencesPackageTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jlavik/src/harvesting-kit/tests/edpsciencespackage_tests.py", line 160, in test_references
self.assertTrue(ref in references)
AssertionError: False is not true
======================================================================
FAIL: test_publication_information (tests.elsevier_package_tests.ElsevierPackageTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jlavik/src/harvesting-kit/tests/elsevier_package_tests.py", line 71, in test_publication_information
self.assertEqual(self.els.get_publication_information(self.document), publication_information)
AssertionError: Tuples differ: ('Physics Letters', '0370-2693... != ('Phys.Lett.', '0370-2693', 'B...
First differing element 0:
Physics Letters
Phys.Lett.
- ('Physics Letters',
+ ('Phys.Lett.',
'0370-2693',
'B206',
'3',
'421',
'426',
'1988',
'1988-05-26',
'10.1016/0370-2693(88)91603-6')
======================================================================
FAIL: test_journal (tests.tests.EDPSciencesPackageTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jlavik/src/harvesting-kit/tests/edpsciencespackage_tests.py", line 58, in test_journal
self.assertEqual(self.edp._get_journal(), 'Astron.Astrophys.')
AssertionError: 'A&A' != 'Astron.Astrophys.'
======================================================================
FAIL: test_publication_information (tests.tests.EDPSciencesPackageTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jlavik/src/harvesting-kit/tests/edpsciencespackage_tests.py", line 99, in test_publication_information
self.assertEqual(self.edp._get_publication_information(), publication_information)
AssertionError: Tuples differ: ('A&A', '565', '', '2014', '20... != ('Astron.Astrophys.', '565', '...
First differing element 0:
A&A
Astron.Astrophys.
- ('A&A',
+ ('Astron.Astrophys.',
'565',
'',
- '2014',
+ u'2014',
? +
'2014-05-23',
u'10.1051/0004-6361/201423985',
'L9',
'925',
'')
======================================================================
FAIL: test_references (tests.tests.EDPSciencesPackageTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jlavik/src/harvesting-kit/tests/edpsciencespackage_tests.py", line 160, in test_references
self.assertTrue(ref in references)
AssertionError: False is not true
======================================================================
FAIL: test_publication_information (tests.tests.ElsevierPackageTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jlavik/src/harvesting-kit/tests/elsevier_package_tests.py", line 71, in test_publication_information
self.assertEqual(self.els.get_publication_information(self.document), publication_information)
AssertionError: Tuples differ: ('Physics Letters', '0370-2693... != ('Phys.Lett.', '0370-2693', 'B...
First differing element 0:
Physics Letters
Phys.Lett.
- ('Physics Letters',
+ ('Phys.Lett.',
'0370-2693',
'B206',
'3',
'421',
'426',
'1988',
'1988-05-26',
'10.1016/0370-2693(88)91603-6')
----------------------------------------------------------------------
Ran 104 tests in 5.135s
FAILED (failures=8)
I cherry picked the pos update for the sprint.
Merged. Thanks!
Two quick comments first:
For the tests, you need to add
__init__.py
and change the commit message to lowercase.tests: unit test suite addition
The
edpssciences
module first commit message also need some love. Capitalt
and typo in the subjectepdsciences
instead ofedpsciences
.Tip: you can use
git rebase -i
and editing each commit there to fix the commits.