]> git.scottworley.com Git - paperdoorknob/commitdiff
test: Don't duplicate list of TeX modules in test
authorScott Worley <scottworley@scottworley.com>
Fri, 29 Dec 2023 08:35:20 +0000 (00:35 -0800)
committerScott Worley <scottworley@scottworley.com>
Fri, 29 Dec 2023 08:35:20 +0000 (00:35 -0800)
paperdoorknob_test.py

index 2787287eb8575145f15d0679582bda386edfe546..a608f8bf89ccfee8facdfd1912ccc12bbd83909c 100644 (file)
@@ -8,6 +8,7 @@
 from abc import ABC, abstractmethod
 import unittest
 import io
 from abc import ABC, abstractmethod
 import unittest
 import io
+import re
 import subprocess
 
 import paperdoorknob
 import subprocess
 
 import paperdoorknob
@@ -45,20 +46,17 @@ class BaseTestProcess(ABC):
             'margin=20mm',
             buf)
         paperdoorknob.process(spec)
             'margin=20mm',
             buf)
         paperdoorknob.process(spec)
-        assert buf.getvalue() == b'''\\documentclass{article}
-\\usepackage{graphicx}
-\\usepackage{varwidth}
-\\usepackage{wrapstuff}
-\\usepackage[margin=20mm]{geometry}
+        assert re.match(br'''\\documentclass{article}
+(\\usepackage{[a-z]+}\n)+\\usepackage\[margin=20mm\]{geometry}
 \\begin{document}
 This is glowfic
 
 \\begin{document}
 This is glowfic
 
-You \\emph{sure}?
+You \\emph{sure}\?
 
 Pretty sure.
 
 \\end{document}
 
 Pretty sure.
 
 \\end{document}
-'''
+''', buf.getvalue())
 
     def testDirectTexifier(self) -> None:
         texifier = VerifyingTexifier(
 
     def testDirectTexifier(self) -> None:
         texifier = VerifyingTexifier(