CERNDocumentServer / harvesting-kit

A kit containing various utilities and scripts related to content harvesting used in Invenio Software (http://invenio-software.org) instances such as INSPIRE (http://inspirehep.net) and SCOAP3 (http://scoap3.org)
GNU General Public License v2.0
7 stars 18 forks source link

Edps fixes #44

Closed GiorgosPa closed 10 years ago

jalavik commented 10 years ago

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. Capital t and typo in the subject epdsciences instead of edpsciences.

Tip: you can use git rebase -i and editing each commit there to fix the commits.

jalavik commented 10 years ago

There are some issues with the tests:

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)
jalavik commented 10 years ago

I cherry picked the pos update for the sprint.

jalavik commented 10 years ago

Merged. Thanks!