• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zopefoundation / z3c.rml / 16098868126

14 Apr 2025 06:50AM UTC coverage: 87.385%. Remained the same
16098868126

push

github

icemac
Back to development: 5.1

561 of 792 branches covered (70.83%)

Branch coverage included in aggregate %.

3990 of 4416 relevant lines covered (90.35%)

0.9 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

65.0
/src/z3c/rml/tests/test_dtd.py
1
##############################################################################
2
#
3
# Copyright (c) 2012 Zope Foundation and Contributors.
4
# All Rights Reserved.
5
#
6
# This software is subject to the provisions of the Zope Public License,
7
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
8
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
9
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
10
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
11
# FOR A PARTLAR PURPOSE.
12
#
13
##############################################################################
14
"""Test generating DTD
15
"""
16
import io
1✔
17
import os
1✔
18
import unittest
1✔
19

20
import lxml.etree
1✔
21

22
from z3c.rml import dtd
1✔
23

24

25
class DTDUnitTestCase(unittest.TestCase):
1✔
26

27
    def runTest(self):
1✔
28
        text = dtd.generate()
1✔
29
        et = lxml.etree.DTD(io.StringIO(text))
1✔
30
        self.assertIsNotNone(next(et.iterelements()))
1✔
31

32

33
class UpdateDTDTestCase(unittest.TestCase):
1✔
34

35
    level = 2
1✔
36

37
    def runTest(self):
1✔
38
        path = os.path.join(os.path.dirname(dtd.__file__), 'rml.dtd')
×
39
        # Write the file.
40
        with open(path, 'w') as file:
×
41
            file.write(dtd.generate())
×
42
        # Ensure we produced a processable DTD.
43
        try:
×
44
            lxml.etree.DTD(path)
×
45
        except BaseException:
×
46
            raise
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc