<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import , print_function , unicode_literals <EOL> from behave import given , then , when <EOL> from docx import Document <EOL> from helpers import test_docx <EOL> @ given ( '<STR_LIT>' ) <EOL> def given_a_table_cell ( context ) : <EOL> table = Document ( test_docx ( '<STR_LIT>' ) ) . tables [ <NUM_LIT:0> ] <EOL> context . cell = table . cell ( <NUM_LIT:0> , <NUM_LIT:0> ) <EOL> @ when ( '<STR_LIT>' ) <EOL> def when_I_add_a_2x2_table_into_the_first_cell ( context ) : <EOL> context . table_ = context . cell . add_table ( <NUM_LIT:2> , <NUM_LIT:2> ) <EOL> @ when ( '<STR_LIT>' ) <EOL> def when_assign_string_to_cell_text_attribute ( context ) : <EOL> cell = context . cell <EOL> text = '<STR_LIT>' <EOL> cell . text = text <EOL> context . expected_text = text <EOL> @ then ( '<STR_LIT>' ) <EOL> def then_cell_tables_0_is_a_2x2_table ( context ) : <EOL> cell = context . cell <EOL> table = cell . tables [ <NUM_LIT:0> ] <EOL> assert len ( table . rows ) == <NUM_LIT:2> <EOL> assert len ( table . columns ) == <NUM_LIT:2> <EOL> @ then ( '<STR_LIT>' ) <EOL> def then_cell_contains_string_assigned ( context ) : <EOL> cell , expected_text = context . cell , context . expected_text <EOL> text = cell . paragraphs [ <NUM_LIT:0> ] . runs [ <NUM_LIT:0> ] . text <EOL> msg = "<STR_LIT>" % ( expected_text , text ) <EOL> assert text == expected_text , msg </s>
