Commit e5772dd2 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Update to renumber tests

parent 9ad6058d
"""test_05_RecordConf """test_06_RecordConf
Test specific methods of the RecordConf class for :: Test specific methods of the RecordConf class for ::
......
"""test_07_RecordThesis """test_08_RecordThesis
Test specific methods of the RecordThesis class for:: Test specific methods of the RecordThesis class for::
...@@ -28,21 +28,21 @@ def reccds(): ...@@ -28,21 +28,21 @@ def reccds():
return load_record("cds.cern.ch", 1632177) return load_record("cds.cern.ch", 1632177)
def test_authors_as_list_cds_07001(reccds): def test_authors_as_list_cds_08001(reccds):
assert reccds.authors_as_list() == [u'Chen, Liming'] assert reccds.authors_as_list() == [u'Chen, Liming']
def test_these_defense_cds_07002(reccds): def test_these_defense_cds_08002(reccds):
assert reccds.these_defense() == "2013-12-10" assert reccds.these_defense() == "2013-12-10"
def test_these_level_cds_07003(reccds): def test_these_level_cds_08003(reccds):
assert reccds.these_level() == "PhD" assert reccds.these_level() == "PhD"
def test_these_directors_cds_07004(reccds): def test_these_directors_cds_08004(reccds):
assert reccds.these_directors(sep=u"|") == "" assert reccds.these_directors(sep=u"|") == ""
def test_these_universities_cds_07005(reccds): def test_these_universities_cds_08005(reccds):
assert reccds.these_universities() == "Shandong U. & Marseille, CPPM" assert reccds.these_universities() == "Shandong U. & Marseille, CPPM"
"""test_08_RecordThesis """test_10_RecordInst
Test specific methods of the RecordInst class for CPPM Test specific methods of the RecordInst class for CPPM
...@@ -13,36 +13,36 @@ def record(): ...@@ -13,36 +13,36 @@ def record():
return load_record("inspirehep.net", 902989, shelf="institutions") return load_record("inspirehep.net", 902989, shelf="institutions")
def test_exception_host_ins_08001(): def test_exception_host_ins_10001():
record = load_record("cds.cern.ch", 1951625) record = load_record("cds.cern.ch", 1951625)
with pytest.raises(RecordException): with pytest.raises(RecordException):
RecordInst(record) RecordInst(record)
def test_exception_record_ins_08002(): def test_exception_record_ins_10002():
record = load_record("inspirehep.net", 1319638, shelf="institutions") record = load_record("inspirehep.net", 1319638, shelf="institutions")
with pytest.raises(RecordException): with pytest.raises(RecordException):
RecordInst(record) RecordInst(record)
def test_future_identifer_ins_08003(record): def test_future_identifer_ins_10003(record):
assert record.future_identifier() == u'CPPM, Marseille' assert record.future_identifier() == u'CPPM, Marseille'
def test_id_ins_08004(record): def test_id_ins_10004(record):
assert record.id() == 902989 assert record.id() == 902989
def test_identifier_ins_08005(record): def test_identifier_ins_10005(record):
assert record.identifier() == u'Marseille, CPPM' assert record.identifier() == u'Marseille, CPPM'
def test_name_ins_08006(record): def test_name_ins_10006(record):
assert record.name() == \ assert record.name() == \
u'Centre de Physique des Particules de Marseille (CPPM)' u'Centre de Physique des Particules de Marseille (CPPM)'
def test_rex_ins_08007(record): def test_rex_ins_10007(record):
assert record.rex() == \ assert record.rex() == \
r"Marseille, CPPM|CPPM, Marseille|" \ r"Marseille, CPPM|CPPM, Marseille|" \
"Centre de Physique des Particules de Marseille (CPPM)" "Centre de Physique des Particules de Marseille (CPPM)"
"""test_09_CheckAndFix_base """test_11_CheckAndFix_base
* Test CheckAndFix methods required by the Automaton base class. * Test CheckAndFix methods required by the Automaton base class.
- constructor - constructor
...@@ -28,22 +28,22 @@ def svc(): ...@@ -28,22 +28,22 @@ def svc():
return CheckAndFix() return CheckAndFix()
def test_constructor_09001(svc): def test_constructor_11001(svc):
assert svc.reg_institute == \ assert svc.reg_institute == \
r"(^|\|)Marseille, CPPM($|\|)|" \ r"(^|\|)Marseille, CPPM($|\|)|" \
r"(^|\|)CPPM, Marseille($|\|)|" \ r"(^|\|)CPPM, Marseille($|\|)|" \
r"(^|\|)Centre de Physique des Particules de Marseille \(CPPM\)($|\|)" r"(^|\|)Centre de Physique des Particules de Marseille \(CPPM\)($|\|)"
def test_is_oai_cds_09002(svc, reccds): def test_is_oai_cds_11002(svc, reccds):
assert svc.is_oai(reccds) assert svc.is_oai(reccds)
def test_is_bad_oai_cds_09003(svc, reccds): def test_is_bad_oai_cds_11003(svc, reccds):
assert not svc.is_bad_oai_used(reccds) assert not svc.is_bad_oai_used(reccds)
def test_temporary_record_cds_09004(svc, reccds): def test_temporary_record_cds_11004(svc, reccds):
assert svc.temporary_record(reccds) is None assert svc.temporary_record(reccds) is None
...@@ -61,11 +61,11 @@ def test_temporary_record_cds_09004(svc, reccds): ...@@ -61,11 +61,11 @@ def test_temporary_record_cds_09004(svc, reccds):
svc.temporary_record(recins) svc.temporary_record(recins)
def test_authors_cds_09005(svc, reccds): def test_authors_cds_11005(svc, reccds):
assert svc.authors(reccds) is None assert svc.authors(reccds) is None
def test__get_author_rescue_list_cds_09006(svc, reccds): def test__get_author_rescue_list_cds_11006(svc, reccds):
assert svc._get_author_rescue_list(reccds, 8, 7) == ["C. Adrover", assert svc._get_author_rescue_list(reccds, 8, 7) == ["C. Adrover",
"S. Akar", "S. Akar",
"E. Aslanides", "E. Aslanides",
...@@ -83,7 +83,7 @@ def test__get_author_rescue_list_cds_09006(svc, reccds): ...@@ -83,7 +83,7 @@ def test__get_author_rescue_list_cds_09006(svc, reccds):
"A. Tsaregorodtsev"] "A. Tsaregorodtsev"]
def test_my_affiliation_cds_09007(svc, reccds): def test_my_affiliation_cds_11007(svc, reccds):
assert svc.my_affiliation(reccds, 8, 7) == "Marseille, CPPM" assert svc.my_affiliation(reccds, 8, 7) == "Marseille, CPPM"
# a paper from NA62 -- no CPPM author # a paper from NA62 -- no CPPM author
...@@ -92,7 +92,7 @@ def test_my_affiliation_cds_09007(svc, reccds): ...@@ -92,7 +92,7 @@ def test_my_affiliation_cds_09007(svc, reccds):
svc.my_affiliation(recna62, id_project=8, id_team=7) svc.my_affiliation(recna62, id_project=8, id_team=7)
def test_search_synonym_09008(): def test_search_synonym_11008():
db = current.db db = current.db
# collaboration ANTARES, TANAMI (defined as synonym in the db) # collaboration ANTARES, TANAMI (defined as synonym in the db)
...@@ -116,5 +116,5 @@ def test_search_synonym_09008(): ...@@ -116,5 +116,5 @@ def test_search_synonym_09008():
assert colid == 2 assert colid == 2
def test_collaboration_cds_09009(svc, reccds): def test_collaboration_cds_11009(svc, reccds):
assert svc.collaboration(reccds) is None assert svc.collaboration(reccds) is None
"""test_10_Automaton """test_12_Automaton
* Test Automaton methods * Test Automaton methods
...@@ -25,7 +25,7 @@ def svc(): ...@@ -25,7 +25,7 @@ def svc():
dry_run=True) dry_run=True)
def test__is_record_in_db_01001(svc): def test__is_record_in_db_12001(svc):
"""The record cds1389970 and ins939619 describe the same LHCb paper. """The record cds1389970 and ins939619 describe the same LHCb paper.
* the paper is loaded in the database from cds.cern.ch. * the paper is loaded in the database from cds.cern.ch.
...@@ -60,7 +60,7 @@ def test__is_record_in_db_01001(svc): ...@@ -60,7 +60,7 @@ def test__is_record_in_db_01001(svc):
assert rec_id_1 == rec_id_2 assert rec_id_1 == rec_id_2
def test_process_recid_01002(svc): def test_process_recid_12002(svc):
"""Test the deepest method to retrieve a record. """Test the deepest method to retrieve a record.
""" """
...@@ -99,7 +99,7 @@ def test_process_recid_01002(svc): ...@@ -99,7 +99,7 @@ def test_process_recid_01002(svc):
del svc.store del svc.store
def test_process_collection_01003(svc): def test_process_collection_12003(svc):
# mimic the previous stage process_url # mimic the previous stage process_url
collection = "LHCb Papers" collection = "LHCb Papers"
...@@ -119,10 +119,10 @@ def test_process_collection_01003(svc): ...@@ -119,10 +119,10 @@ def test_process_collection_01003(svc):
del svc.store del svc.store
def test_process_url_cds_01004(svc): def test_process_url_cds_12004(svc):
assert svc.process_url("cds.cern.ch", "LHCb Papers") is None assert svc.process_url("cds.cern.ch", "LHCb Papers") is None
def test_process_url_ins_01005(svc): def test_process_url_ins_12005(svc):
assert svc.process_url( assert svc.process_url(
"inspirehep.net", "find cn lhcb and tc p and not tc c") is None "inspirehep.net", "find cn lhcb and tc p and not tc c") is None
"""test_11_CheckAndFix_article """test_13_CheckAndFix_article
* Test CheckAndFix methods for article: * Test CheckAndFix methods for article:
- format_editor - format_editor
...@@ -33,7 +33,7 @@ def svc(): ...@@ -33,7 +33,7 @@ def svc():
return CheckAndFix() return CheckAndFix()
def test_format_editor_cds_11001(svc, reccds): def test_format_editor_cds_13001(svc, reccds):
# cds # cds
assert reccds.paper_editor() == "Phys. Rev. D" assert reccds.paper_editor() == "Phys. Rev. D"
...@@ -45,7 +45,7 @@ def test_format_editor_cds_11001(svc, reccds): ...@@ -45,7 +45,7 @@ def test_format_editor_cds_11001(svc, reccds):
assert reccds.paper_volume() == "95" assert reccds.paper_volume() == "95"
def test_format_editor_ins_11002(svc, recins): def test_format_editor_ins_13002(svc, recins):
# inspire # inspire
assert recins.paper_editor() == "Phys.Rev." assert recins.paper_editor() == "Phys.Rev."
assert recins.paper_volume() == "D95" assert recins.paper_volume() == "D95"
...@@ -56,11 +56,11 @@ def test_format_editor_ins_11002(svc, recins): ...@@ -56,11 +56,11 @@ def test_format_editor_ins_11002(svc, recins):
assert recins.paper_volume() == "95" assert recins.paper_volume() == "95"
def test_publisher_cds_11003(svc, reccds): def test_publisher_cds_13003(svc, reccds):
assert svc.publisher(reccds) is None assert svc.publisher(reccds) is None
def test_paper_reference_cds_11004(svc, reccds): def test_paper_reference_cds_13004(svc, reccds):
# check recovery procedure using DOI # check recovery procedure using DOI
# remove the publisher and volume information # remove the publisher and volume information
...@@ -72,7 +72,7 @@ def test_paper_reference_cds_11004(svc, reccds): ...@@ -72,7 +72,7 @@ def test_paper_reference_cds_11004(svc, reccds):
assert reccds.paper_reference() == paper_ref assert reccds.paper_reference() == paper_ref
def test_submitted_cds_11005(svc, reccds): def test_submitted_cds_13005(svc, reccds):
assert reccds.submitted() == "19 Jan 2017" assert reccds.submitted() == "19 Jan 2017"
svc.submitted(reccds) svc.submitted(reccds)
...@@ -89,12 +89,12 @@ def test_submitted_cds_11005(svc, reccds): ...@@ -89,12 +89,12 @@ def test_submitted_cds_11005(svc, reccds):
assert reccds.submitted() == "2017-01" assert reccds.submitted() == "2017-01"
def test_submitted_ins_11006(svc, recins): def test_submitted_ins_13006(svc, recins):
assert recins.submitted() == "2017-01-19" assert recins.submitted() == "2017-01-19"
def test_format_authors_cds_11007(svc, reccds): def test_format_authors_cds_13007(svc, reccds):
authors = reccds.authors_as_list() authors = reccds.authors_as_list()
...@@ -113,7 +113,7 @@ def test_format_authors_cds_11007(svc, reccds): ...@@ -113,7 +113,7 @@ def test_format_authors_cds_11007(svc, reccds):
assert authors[-1] == "S. Zucchelli" assert authors[-1] == "S. Zucchelli"
def test_get_my_authors_cds_11008(svc, reccds): def test_get_my_authors_cds_13008(svc, reccds):
svc.format_authors(reccds, fmt="F. Last") svc.format_authors(reccds, fmt="F. Last")
assert svc.get_my_authors(reccds, sep="|", sort=True) is None assert svc.get_my_authors(reccds, sep="|", sort=True) is None
......
"""test_12_CheckAndFix_proceeding """test_14_CheckAndFix_proceeding
* Test CheckAndFix methods for proceeding. * Test CheckAndFix methods for proceeding.
Use the same proceeding in cds.cern.ch and inspirehep.net Use the same proceeding in cds.cern.ch and inspirehep.net
...@@ -39,7 +39,7 @@ def svc(): ...@@ -39,7 +39,7 @@ def svc():
return CheckAndFix() return CheckAndFix()
def test_is_conference_cds_12001(svc, reccds): def test_is_conference_cds_14001(svc, reccds):
assert svc.is_conference(reccds) is None assert svc.is_conference(reccds) is None
# test exception # test exception
...@@ -50,26 +50,26 @@ def test_is_conference_cds_12001(svc, reccds): ...@@ -50,26 +50,26 @@ def test_is_conference_cds_12001(svc, reccds):
svc.is_conference(reccds2) svc.is_conference(reccds2)
def test_is_conference_ins_12002(svc, recins): def test_is_conference_ins_14002(svc, recins):
assert svc.is_conference(recins) is None assert svc.is_conference(recins) is None
def test_country_cds_12003(svc, reccds): def test_country_cds_14003(svc, reccds):
assert svc.country(reccds) is None assert svc.country(reccds) is None
def test_country_ins_12004(svc, recins): def test_country_ins_14004(svc, recins):
assert svc.country(recins) is None assert svc.country(recins) is None
def test_conference_date_cds_12005(svc, reccds): def test_conference_date_cds_14005(svc, reccds):
assert reccds.conference_dates() == "6 - 11 Dec 2010" assert reccds.conference_dates() == "6 - 11 Dec 2010"
svc.conference_date(reccds) svc.conference_date(reccds)
assert reccds.conference_dates() == "6-11 Dec 2010" assert reccds.conference_dates() == "6-11 Dec 2010"
def test_conference_date_cds_12006(svc): def test_conference_date_cds_14006(svc):
reccds = load_record("cds.cern.ch", 2688580) reccds = load_record("cds.cern.ch", 2688580)
assert reccds.conference_dates() == "04-06 Sept 2019" assert reccds.conference_dates() == "04-06 Sept 2019"
...@@ -78,20 +78,20 @@ def test_conference_date_cds_12006(svc): ...@@ -78,20 +78,20 @@ def test_conference_date_cds_12006(svc):
assert reccds.conference_dates() == "4-6 Sep 2019" assert reccds.conference_dates() == "4-6 Sep 2019"
def test_conference_date_ins_12007(svc, recins): def test_conference_date_ins_14007(svc, recins):
assert recins.conference_dates() == "6-11 Dec 2010" assert recins.conference_dates() == "6-11 Dec 2010"
svc.conference_date(recins) svc.conference_date(recins)
assert recins.conference_dates() == "6-11 Dec 2010" assert recins.conference_dates() == "6-11 Dec 2010"
def test_submitted_cds_12008(svc, reccds): def test_submitted_cds_14008(svc, reccds):
assert reccds.submitted() == "05 Jan 2012" assert reccds.submitted() == "05 Jan 2012"
svc.submitted(reccds) svc.submitted(reccds)
assert reccds.submitted() == "2012-01-05" assert reccds.submitted() == "2012-01-05"
def test_submitted_ins_12009(svc, recins): def test_submitted_ins_14009(svc, recins):
assert recins.submitted() == "2011" assert recins.submitted() == "2011"
svc.submitted(recins) svc.submitted(recins)
assert recins.submitted() == "2010-12-06" assert recins.submitted() == "2010-12-06"
"""test_13_CheckAndFix_thesis """test_15_CheckAndFix_thesis
* Test CheckAndFix methods for thesis. * Test CheckAndFix methods for thesis.
Use the one talk in cds.cern.ch Use the one talk in cds.cern.ch
...@@ -26,11 +26,11 @@ def svc(): ...@@ -26,11 +26,11 @@ def svc():
return CheckAndFix() return CheckAndFix()
def test_is_thesis_cds_13001(svc, reccds): def test_is_thesis_cds_15001(svc, reccds):
assert svc.is_thesis(reccds) is None assert svc.is_thesis(reccds) is None
def test_submitted_cds_13002(svc, reccds): def test_submitted_cds_15002(svc, reccds):
assert reccds.these_defense() == "2011" assert reccds.these_defense() == "2011"
assert reccds.submitted() == "" assert reccds.submitted() == ""
...@@ -39,7 +39,7 @@ def test_submitted_cds_13002(svc, reccds): ...@@ -39,7 +39,7 @@ def test_submitted_cds_13002(svc, reccds):
assert reccds.submitted() == "2011-11" assert reccds.submitted() == "2011-11"
def test_format_universities_cds_13003(svc, reccds): def test_format_universities_cds_15003(svc, reccds):
# Khanji en 2011 (Université de la Méditerrannée) # Khanji en 2011 (Université de la Méditerrannée)
assert reccds["dissertation_note"]["university"] == \ assert reccds["dissertation_note"]["university"] == \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment