@@ -329,46 +329,6 @@ def test_read_binary_preview() -> None:
329
329
pass
330
330
331
331
332
- def test_readline_psfile (tmp_path : Path ) -> None :
333
- # check all the freaking line endings possible from the spec
334
- # test_string = u'something\r\nelse\n\rbaz\rbif\n'
335
- line_endings = ["\r \n " , "\n " , "\n \r " , "\r " ]
336
- strings = ["something" , "else" , "baz" , "bif" ]
337
-
338
- def _test_readline (t : EpsImagePlugin .PSFile , ending : str ) -> None :
339
- ending = f"Failure with line ending: { '' .join (str (ord (s )) for s in ending )} "
340
- assert t .readline ().strip ("\r \n " ) == "something" , ending
341
- assert t .readline ().strip ("\r \n " ) == "else" , ending
342
- assert t .readline ().strip ("\r \n " ) == "baz" , ending
343
- assert t .readline ().strip ("\r \n " ) == "bif" , ending
344
-
345
- def _test_readline_io_psfile (test_string : str , ending : str ) -> None :
346
- f = io .BytesIO (test_string .encode ("latin-1" ))
347
- with pytest .warns (DeprecationWarning ):
348
- t = EpsImagePlugin .PSFile (f )
349
- _test_readline (t , ending )
350
-
351
- def _test_readline_file_psfile (test_string : str , ending : str ) -> None :
352
- f = str (tmp_path / "temp.txt" )
353
- with open (f , "wb" ) as w :
354
- w .write (test_string .encode ("latin-1" ))
355
-
356
- with open (f , "rb" ) as r :
357
- with pytest .warns (DeprecationWarning ):
358
- t = EpsImagePlugin .PSFile (r )
359
- _test_readline (t , ending )
360
-
361
- for ending in line_endings :
362
- s = ending .join (strings )
363
- _test_readline_io_psfile (s , ending )
364
- _test_readline_file_psfile (s , ending )
365
-
366
-
367
- def test_psfile_deprecation () -> None :
368
- with pytest .warns (DeprecationWarning ):
369
- EpsImagePlugin .PSFile (None )
370
-
371
-
372
332
@pytest .mark .parametrize ("prefix" , (b"" , simple_binary_header ))
373
333
@pytest .mark .parametrize (
374
334
"line_ending" ,
0 commit comments