<s> from __future__ import ( <EOL> absolute_import , <EOL> print_function , <EOL> unicode_literals , <EOL> ) <EOL> import unittest <EOL> from pydocx . util . xml import xml_tag_split <EOL> from pydocx . openxml . packaging import MainDocumentPart , WordprocessingDocument <EOL> class WordprocessingDocumentTestCase ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . document = WordprocessingDocument ( <EOL> path = '<STR_LIT>' , <EOL> ) <EOL> def test_document_is_the_open_xml_package ( self ) : <EOL> self . assertEqual ( <EOL> self . document , <EOL> self . document . main_document_part . open_xml_package , <EOL> ) <EOL> def test_get_parts_of_type_office_document ( self ) : <EOL> self . assertEqual ( <EOL> self . document . get_parts_of_type ( <EOL> MainDocumentPart . relationship_type , <EOL> ) [ <NUM_LIT:0> ] , <EOL> self . document . main_document_part , <EOL> ) <EOL> def test_main_document_part_uri ( self ) : <EOL> self . assertEqual ( <EOL> self . document . main_document_part . uri , <EOL> '<STR_LIT>' , <EOL> ) <EOL> def test_main_document_part_root ( self ) : <EOL> namespace , tag = xml_tag_split ( <EOL> self . document . main_document_part . root_element . tag , <EOL> ) <EOL> self . assertEqual ( namespace , None ) <EOL> self . assertEqual ( tag , '<STR_LIT>' ) <EOL> def test_main_document_part_relationship_uri ( self ) : <EOL> part = self . document . package . get_part ( <EOL> self . document . main_document_part . uri , <EOL> ) <EOL> self . assertEqual ( <EOL> part . relationship_uri , <EOL> '<STR_LIT>' , <EOL> ) <EOL> def test_main_document_part_styles_uri ( self ) : <EOL> styles = self . document . main_document_part . style_definitions_part <EOL> self . assertEqual ( <EOL> styles . uri , <EOL> '<STR_LIT>' , <EOL> ) <EOL> def test_main_document_part_font_table_uri ( self ) : <EOL> font_table = self . document . main_document_part . font_table_part <EOL> self . assertEqual ( <EOL> font_table . uri , <EOL> '<STR_LIT>' , <EOL> ) <EOL> def test_nonexistent_numbering_definitions_part ( self ) : <EOL> part = self . document . main_document_part . numbering_definitions_part <EOL> self . assertNotEqual ( part , None ) <EOL> self . assertEqual ( part . root_element , None ) <EOL> def test_image_parts ( self ) : <EOL> image_document = WordprocessingDocument ( <EOL> path = '<STR_LIT>' , <EOL> ) <EOL> parts = image_document . main_document_part . image_parts <EOL> self . assertEqual ( len ( parts ) , <NUM_LIT:1> ) <EOL> self . assertEqual ( parts [ <NUM_LIT:0> ] . uri , '<STR_LIT>' ) </s>
