aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2013-12-01 11:26:10 +0000
committerMichael Williamson <mike@zwobble.org>2013-12-01 11:26:10 +0000
commitdc381b5afcae0994094d49465142e6099dcec86c (patch)
tree0624f7068dfb5ec9d6ffac0d94d488e93f842c3d /tests
parent68047ef381cb08cf43e5a30ca9dd6e40ccde8cdd (diff)
Add style_name to paragraphs
Diffstat (limited to 'tests')
-rw-r--r--tests/docx_tests.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/docx_tests.py b/tests/docx_tests.py
index d5f4990..80253fa 100644
--- a/tests/docx_tests.py
+++ b/tests/docx_tests.py
@@ -11,7 +11,7 @@ class ReadTests(object):
with open(test_path("single-paragraph.docx")) as fileobj:
result = docx.read(fileobj=fileobj)
expected_document = documents.Document([
- documents.Paragraph([
+ documents.paragraph([
documents.Run([
documents.Text("Walking on imported air")
])
@@ -39,7 +39,7 @@ class ReadXmlElementTests(object):
def can_read_text_within_paragraph(self):
element = _paragraph_element_with_text("Hello!")
assert_equal(
- documents.Paragraph([documents.Run([documents.Text("Hello!")])]),
+ documents.paragraph([documents.Run([documents.Text("Hello!")])]),
docx.read_xml_element(element)
)
@@ -47,9 +47,14 @@ class ReadXmlElementTests(object):
def can_read_text_within_document(self):
element = _document_element_with_text("Hello!")
assert_equal(
- documents.Document([documents.Paragraph([documents.Run([documents.Text("Hello!")])])]),
+ documents.Document([documents.paragraph([documents.Run([documents.Text("Hello!")])])]),
docx.read_xml_element(element)
)
+
+ @istest
+ def paragraph_has_no_style_if_it_has_no_properties(self):
+ element = xml_element("w:p")
+ assert_equal(None, docx.read_xml_element(element).style_name)
@istest
def unrecognised_elements_are_ignored(self):