aboutsummaryrefslogtreecommitdiff
path: root/tests/docx/document_xml_tests.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2022-11-25 22:50:05 +0000
committerMichael Williamson <mike@zwobble.org>2022-11-25 22:58:16 +0000
commit5093d72b9fece1a7c3d7a3d19e4161387ee6475a (patch)
treec4122b0f72c7864897d78333e75328ac8c22685b /tests/docx/document_xml_tests.py
parent20e3e61530bef546058124c3015ae240733cc974 (diff)
Use pytest instead of nose
Diffstat (limited to 'tests/docx/document_xml_tests.py')
-rw-r--r--tests/docx/document_xml_tests.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/tests/docx/document_xml_tests.py b/tests/docx/document_xml_tests.py
index fa63775..e93392c 100644
--- a/tests/docx/document_xml_tests.py
+++ b/tests/docx/document_xml_tests.py
@@ -1,33 +1,29 @@
-from nose.tools import istest, assert_equal
-
from mammoth import documents
from mammoth.docx.xmlparser import element as xml_element, text as xml_text
from mammoth.docx.document_xml import read_document_xml_element
from mammoth.docx import body_xml
+from ..testing import assert_equal
-@istest
class ReadXmlElementTests(object):
- @istest
- def can_read_text_within_document(self):
+ def test_can_read_text_within_document(self):
element = _document_element_with_text("Hello!")
assert_equal(
documents.document([documents.paragraph([documents.run([documents.Text("Hello!")])])]),
_read_and_get_document_xml_element(element)
)
-
- @istest
- def footnotes_of_document_are_read(self):
+
+ def test_footnotes_of_document_are_read(self):
notes = [documents.note("footnote", "4", [documents.paragraph([])])]
-
+
body_xml = xml_element("w:body")
document_xml = xml_element("w:document", {}, [body_xml])
-
+
document = _read_and_get_document_xml_element(document_xml, notes=notes)
footnote = document.notes.find_note("footnote", "4")
assert_equal("4", footnote.note_id)
assert isinstance(footnote.body[0], documents.Paragraph)
-
+
def _read_and_get_document_xml_element(*args, **kwargs):
body_reader = body_xml.reader()