22import os
33from typing import Dict , List
44
5- from bibtex_linter .parser import EntryType , BibTeXEntry , split_entries , parse_bibtex_file
5+ from bibtex_linter .parser import BibTeXEntry , split_entries , parse_bibtex_file
66
77
88class TestBibTeXEntry (unittest .TestCase ):
@@ -245,15 +245,15 @@ def test_parse_all_entries(self) -> None:
245245 self .assertEqual (17 , len (entries ))
246246
247247 expected_types = {
248- EntryType . ARTICLE : 1 ,
249- EntryType . CONFERENCE : 1 ,
250- EntryType . ONLINE : 1 ,
251- EntryType . TECH_REPORT : 1 ,
252- EntryType . BOOK : 1 ,
253- EntryType . MISC : 9 ,
254- EntryType . STANDARD : 1 ,
255- EntryType . IN_BOOK : 1 ,
256- EntryType . IN_COLLECTION : 1 ,
248+ "article" : 1 ,
249+ "conference" : 1 ,
250+ "online" : 1 ,
251+ "techreport" : 1 ,
252+ "book" : 1 ,
253+ "misc" : 9 ,
254+ "standard" : 1 ,
255+ "inbook" : 1 ,
256+ "incollection" : 1 ,
257257 }
258258
259259 for entry_type , expected_count in expected_types .items ():
@@ -262,121 +262,121 @@ def test_parse_all_entries(self) -> None:
262262 self .assertEqual (expected_count , actual_count )
263263
264264 def test_entry_fields_and_values (self ) -> None :
265- expected_entries : List [Dict [str , EntryType | Dict [str , str ]]] = [
265+ expected_entries : List [Dict [str , str | Dict [str , str ]]] = [
266266 {
267- "type" : EntryType . ARTICLE ,
267+ "type" : "article" ,
268268 "fields" : {
269269 "author" : "Tests basic article" ,
270270 "title" : "Standard field format" ,
271271 "year" : "2020"
272272 }
273273 },
274274 {
275- "type" : EntryType . CONFERENCE ,
275+ "type" : "conference" ,
276276 "fields" : {
277277 "author" : "Should map to CONFERENCE" ,
278278 "title" : "Using alias INPROCEEDINGS" ,
279279 "year" : "2021"
280280 }
281281 },
282282 {
283- "type" : EntryType . ONLINE ,
283+ "type" : "online" ,
284284 "fields" : {
285285 "author" : "Should map to ONLINE" ,
286286 "url" : "https://example.com"
287287 }
288288 },
289289 {
290- "type" : EntryType . TECH_REPORT ,
290+ "type" : "techreport" ,
291291 "fields" : {
292292 "author" : "Should map to TECH_REPORT" ,
293293 "title" : "Tech report via alias"
294294 }
295295 },
296296 {
297- "type" : EntryType . BOOK ,
297+ "type" : "book" ,
298298 "fields" : {
299299 "author" : "Extra spaces around field and value" ,
300300 "title" : "Trimmed Title" ,
301301 "year" : "2023"
302302 }
303303 },
304304 {
305- "type" : EntryType . MISC ,
305+ "type" : "misc" ,
306306 "fields" : {
307307 "note" : "This has nested braces inside" ,
308308 "comment" : "But only outermost braces should be stripped"
309309 }
310310 },
311311 {
312- "type" : EntryType . MISC ,
312+ "type" : "misc" ,
313313 "fields" : {
314314 "author" : "Double brace test" ,
315315 "title" : "Another level of nesting"
316316 }
317317 },
318318 {
319- "type" : EntryType . MISC ,
319+ "type" : "misc" ,
320320 "fields" : {
321321 "author" : "Quoted Author" ,
322322 "title" : "Simple quoted title"
323323 }
324324 },
325325 {
326- "type" : EntryType . MISC ,
326+ "type" : "misc" ,
327327 "fields" : {
328328 "note" : "This value\n spans multiple\n lines"
329329 }
330330 },
331331 {
332- "type" : EntryType . MISC ,
332+ "type" : "misc" ,
333333 "fields" : {
334334 "howpublished" : r"\url{https://wrapped-url.com}"
335335 }
336336 },
337337 {
338- "type" : EntryType . MISC ,
338+ "type" : "misc" ,
339339 "fields" : {
340340 "title" : r"\LaTeX command in value"
341341 }
342342 },
343343 {
344- "type" : EntryType . MISC ,
344+ "type" : "misc" ,
345345 "fields" : {
346346 "author" : "Trailing Comma" ,
347347 "title" : "Should be OK"
348348 }
349349 },
350350 {
351- "type" : EntryType . MISC ,
351+ "type" : "misc" ,
352352 "fields" : {
353353 "author" : "No Trailing Comma"
354354 }
355355 },
356356 {
357- "type" : EntryType . MISC ,
357+ "type" : "misc" ,
358358 "fields" : {
359359 "author" : "Newlines and spacing\n everywhere" ,
360360 "title" : "Still valid"
361361 }
362362 },
363363 {
364- "type" : EntryType . STANDARD ,
364+ "type" : "standard" ,
365365 "fields" : {
366366 "author" : "Tests EntryType.STANDARD" ,
367367 "title" : "Formal standard ref"
368368 }
369369 },
370370 {
371- "type" : EntryType . IN_BOOK ,
371+ "type" : "inbook" ,
372372 "fields" : {
373373 "author" : "Part of a book" ,
374374 "title" : "Chapter Title" ,
375375 "booktitle" : "Whole Book Title"
376376 }
377377 },
378378 {
379- "type" : EntryType . IN_COLLECTION ,
379+ "type" : "incollection" ,
380380 "fields" : {
381381 "author" : "Self-contained part of a collection" ,
382382 "title" : "In Collection Title" ,
0 commit comments