@@ -43,28 +43,26 @@ def test_to_short_lcc(sortable_lcc, raw_lcc, short_lcc, name):
4343
4444
4545INVALID_TESTS = [
46- ('6113 .136' , 'dewey decimal ' ),
47- ('9608 BOOK NOT YET IN LC' , 'noise ' ),
48- ('#M8184' , 'hash prefixed ' ),
49- ('' , 'empty ' ),
50- ('MLCS 92/14990' , 'too much class ' ),
51- ('PZ123.234.234' , 'too much decimal ' ),
52- # The following are "real world" data from open library
53- ('IN PROCESS' , 'noise ' ),
54- ('African Section Pamphlet Coll' , 'real ol data ' ),
55- ('Microfilm 99/20' , 'real ol data ' ),
56- ('Microfilm 61948 E' , 'real ol data ' ),
57- ('Microfiche 92/80965 (G)' , 'real ol data ' ),
58- ('MLCSN+' , 'real ol data ' ),
59- ('UNCLASSIFIED 809 (S)' , 'real ol data ' ),
60- ('CPB Box no. 1516 vol. 17' , 'CPB box number ' ),
46+ pytest . param ('6113 .136' , id = 'dewey_decimal ' ),
47+ pytest . param ('9608 BOOK NOT YET IN LC' , id = 'noise_lc_missing ' ),
48+ pytest . param ('#M8184' , id = 'hash_prefixed ' ),
49+ pytest . param ('' , id = 'empty_string ' ),
50+ pytest . param ('MLCS 92/14990' , id = 'excessive_class_info ' ),
51+ pytest . param ('PZ123.234.234' , id = 'too_many_decimals ' ),
52+ # "Real world" data from Open Library
53+ pytest . param ('IN PROCESS' , id = 'noise_in_process ' ),
54+ pytest . param ('African Section Pamphlet Coll' , id = 'ol_african_section ' ),
55+ pytest . param ('Microfilm 99/20' , id = 'ol_microfilm_99_20 ' ),
56+ pytest . param ('Microfilm 61948 E' , id = 'ol_microfilm_61948 ' ),
57+ pytest . param ('Microfiche 92/80965 (G)' , id = 'ol_microfiche_92 ' ),
58+ pytest . param ('MLCSN+' , id = 'ol_mlcsn_plus ' ),
59+ pytest . param ('UNCLASSIFIED 809 (S)' , id = 'ol_unclassified_809 ' ),
60+ pytest . param ('CPB Box no. 1516 vol. 17' , id = 'cpb_box_number ' ),
6161]
6262
6363
64- @pytest .mark .parametrize (
65- ('text' , 'name' ), INVALID_TESTS , ids = [t [- 1 ] for t in INVALID_TESTS ]
66- )
67- def test_invalid_lccs (text , name ):
64+ @pytest .mark .parametrize ('text' , INVALID_TESTS )
65+ def test_invalid_lccs (text ):
6866 assert short_lcc_to_sortable_lcc (text ) is None
6967
7068
@@ -107,14 +105,14 @@ def test_wagner_2019_to_short_lcc(sortable_lcc, short_lcc, name):
107105 ('A' , 'A' , 'Single letter' ),
108106 ('ADC' , 'ADC' , 'multi letter' ),
109107 ('A5' , 'A--0005' , 'Alphanum' ),
110- ('A5.00' , 'A--0005.00' , 'Alphanum' ),
108+ ('A5.00' , 'A--0005.00' , 'Alphanum 2 ' ),
111109 ('A10' , 'A--0010' , 'Alphanum trailing 0' ),
112110 ('A10.5' , 'A--0010.5' , 'Alphanum with decimal' ),
113111 ('A10.' , 'A--0010' , 'Alphanum with trailing decimal' ),
114112 ('A10.C' , 'A--0010.00000000.C' , 'Alphanum with partial cutter' ),
115113 ('F349.N2 A77' , 'F--0349.00000000.N2 A77' , '2 cutters' ),
116114 ('123' , None , 'Invalid returns None' ),
117- ('*B55' , None , 'Invalid returns None' ),
115+ ('*B55' , None , 'Invalid also returns None' ),
118116]
119117
120118
0 commit comments