summaryrefslogtreecommitdiff
path: root/app-text/xml2rfc/files/xml2rfc-Remove-broken-test.patch
diff options
context:
space:
mode:
Diffstat (limited to 'app-text/xml2rfc/files/xml2rfc-Remove-broken-test.patch')
-rw-r--r--app-text/xml2rfc/files/xml2rfc-Remove-broken-test.patch79
1 files changed, 79 insertions, 0 deletions
diff --git a/app-text/xml2rfc/files/xml2rfc-Remove-broken-test.patch b/app-text/xml2rfc/files/xml2rfc-Remove-broken-test.patch
new file mode 100644
index 000000000000..d7d027962c24
--- /dev/null
+++ b/app-text/xml2rfc/files/xml2rfc-Remove-broken-test.patch
@@ -0,0 +1,79 @@
+From ed27e2983c27065bd88ac82cd26a5b9128544b45 Mon Sep 17 00:00:00 2001
+From: Florian Schmaus <flo@geekplace.eu>
+Date: Fri, 28 Oct 2022 20:18:10 +0200
+Subject: [PATCH] Remove broken test
+
+--- a/test.py
++++ b/test.py
+@@ -466,71 +466,6 @@ class WriterRfcTest(WriterRootTest):
+ return self.status_test()
+
+
+-class PdfWriterTests(unittest.TestCase):
+- elements_root = None
+- elements_pdfxml = None
+-
+- @classmethod
+- def setUpClass(cls) -> None:
+- # Putting this in setUpClass() allows this module to be imported even if this
+- # procedure will fail. This improves some error messages and makes debugging
+- # a little bit easier. The setUpClass() method is run by unittest during init.
+- # This happens only once, avoiding repeated execution of slow operations.
+- def _pdfwriter(path):
+- """ Parse a minimal RFC tree and instantiate a writer """
+- parser = xml2rfc.XmlRfcParser(path, quiet=True, **options_for_xmlrfcparser)
+- xmlrfc = parser.parse()
+- writer = xml2rfc.writers.pdf.PdfWriter(xmlrfc, quiet=True, )
+- return writer
+-
+- elements_writer = _pdfwriter('tests/input/elements.xml')
+- try:
+- elements_pdfdoc = elements_writer.pdf() # has side effects on .root
+- except Exception as e:
+- print(e)
+- raise
+- cls.pdf_writer = elements_writer
+- cls.elements_root = elements_writer.root
+- cls.elements_pdfxml = xmldoc(None, bytes=elements_pdfdoc)
+-
+- def setUp(self):
+- xml2rfc.log.quiet = True
+- self.pdfxml = copy.deepcopy(self.elements_pdfxml)
+- self.root = copy.deepcopy(self.elements_root)
+-
+- def test_text_content(self):
+- def norm(t):
+- return re.sub(r'\s+', ' ', t).strip()
+- #
+- text = norm('\n'.join( p.text for p in self.pdfxml.xpath('.//Page/text') ))
+- for e in self.root.xpath('./middle//*'):
+- if e.text and e.text.strip() and e.tag not in xml2rfc.util.unicode.unicode_content_tags and not xml2rfc.util.unicode.is_svg(e):
+- t = norm(e.text.split(None, 1)[0])
+- self.assertIn(t, text)
+-
+- def test_included_fonts(self):
+- if xml2rfc.HAVE_WEASYPRINT and xml2rfc.HAVE_PANGO:
+- font_families = set([ f.text for f in self.pdfxml.xpath('.//FontFamily') ])
+- for script in self.root.get('scripts').split(','):
+- family = xml2rfc.util.fonts.get_noto_serif_family_for_script(script)
+- self.assertIn(family, font_families, 'Missing font match for %s' % script)
+-
+- def test_flatten_unicode_spans(self):
+- input_html = '<body><p>f<span class="unicode">o</span>o<span class="unicode">ba</span>r</p></body>'
+- output_html = self.pdf_writer.flatten_unicode_spans(input_html)
+- self.assertEqual(output_html, '<body><p>foobar</p></body>')
+-
+- def test_get_serif_fonts(self):
+- fonts = self.pdf_writer.get_serif_fonts()
+- for font in ['Noto Serif', 'Noto Sans Cherokee', 'Noto Serif CJK SC', 'Noto Serif Hebrew']:
+- self.assertIn(font, fonts)
+-
+- def test_get_mono_fonts(self):
+- fonts = self.pdf_writer.get_mono_fonts()
+- for font in ['Roboto Mono', 'Noto Sans Cherokee', 'Noto Serif CJK SC', 'Noto Serif Hebrew']:
+- self.assertIn(font, fonts)
+-
+-
+ class HtmlWriterTest(unittest.TestCase):
+ '''HtmlWriter tests'''
+