def represent_outlines(self): """ Render the outlines table. """ return strings.represent_table( self.outlines_table, indent=self.indent + 2)
def example_wrapper(term, scenario, outline, steps): """Display scenario execution.""" try: if scenario.tags: term.writeln(term.cyan(scenario.represent_tags())) start, end = scenario.represented().rsplit('#') term.write(term.bold_white(start)) term.writeln(term.color(8)(end)) if outline: term.writeln( represent_table( [outline.keys(), outline.values()], indent=6, cell_wrap=term.white)) term.writeln() # write a preview of the steps if term.is_a_tty: steps_ = [] if scenario.feature.background: steps_ += scenario.feature.background.steps steps_ += steps term.writeln(term.color(8)('\n'.join( step.represented(annotate=False) for step in steps_) + '\n'), return_=True) yield finally: term.writeln()
def represent_outlines(self): """ Render the outlines table. """ return strings.represent_table(self.outlines_table, indent=self.indent + 2)
def example_wrapper(term, scenario, outline, steps): """Display scenario execution.""" try: if scenario.tags: term.writeln(term.tag(scenario.represent_tags())) represented = scenario.represented() represented = ljust(represented, scenario.feature.max_length + 2) term.write(represented) term.writeln(term.comment('# ' + scenario.location)) if outline: term.writeln( represent_table( [outline.keys(), outline.values()], indent=6)) term.writeln() # write a preview of the steps if term.is_a_tty: steps_ = [] if scenario.feature.background: steps_ += scenario.feature.background.steps steps_ += steps term.writeln(term.preview('\n'.join(step.represented() for step in steps_) + '\n'), return_=True) yield finally: term.writeln()
def represent_table(self, **kwargs): """ Render the table. :param cell_wrap: color to use inside the table cells """ return strings.represent_table(self.table, indent=self.indent + 2, **kwargs)
def represent_table(self, **kwargs): """ Render the table. :param cell_wrap: color to use inside the table cells """ return strings.represent_table( self.table, indent=self.indent + 2, **kwargs)
def test_represent_table(): """ Test representing a table """ table = [ ['name', 'age'], [u'Gabriel Falcão', 22], ['Miguel', 19], ] assert_equal( strings.represent_table(table), u"| name | age |\n" u"| Gabriel Falcão | 22 |\n" u"| Miguel | 19 |")
def test_represent_table_allows_empty(): """ Test representing a table with an empty cell """ table = [ ['name', 'age'], [u'Gabriel | Falcão', 22], ['Miguel | Arcanjo', ''], ] assert_equal( strings.represent_table(table), '\n'.join(( r"| name | age |", r"| Gabriel \| Falcão | 22 |", r"| Miguel \| Arcanjo | |", )))
def test_represent_table_escapes_pipe(): """ Test representing a table with escaping """ table = [ ['name', 'age'], [u'Gabriel | Falcão', 22], ['Miguel | Arcanjo', 19], ] assert_equal( strings.represent_table(table), '\n'.join(( r"| name | age |", r"| Gabriel \| Falcão | 22 |", r"| Miguel \| Arcanjo | 19 |", )))
def test_represent_table(): """ Test representing a table """ table = [ ['name', 'age'], [u'Gabriel Falcão', 22], ['Miguel', 19], ] assert_equal( strings.represent_table(table), u"| name | age |\n" u"| Gabriel Falcão | 22 |\n" u"| Miguel | 19 |" )
def test_represent_table_allows_empty(): """ Test representing a table with an empty cell """ table = [ ['name', 'age'], [u'Gabriel | Falcão', 22], ['Miguel | Arcanjo', ''], ] assert_equal( strings.represent_table(table), '\n'.join(( r"| name | age |", r"| Gabriel \| Falcão | 22 |", r"| Miguel \| Arcanjo | |", )) )
def test_represent_table_escapes_pipe(): """ Test representing a table with escaping """ table = [ ['name', 'age'], [u'Gabriel | Falcão', 22], ['Miguel | Arcanjo', 19], ] assert_equal( strings.represent_table(table), '\n'.join(( r"| name | age |", r"| Gabriel \| Falcão | 22 |", r"| Miguel \| Arcanjo | 19 |", )) )
def example_wrapper(term, scenario, outline, steps): """Display scenario execution.""" try: if scenario.tags: term.writeln(term.cyan(scenario.represent_tags())) represented = scenario.represented() represented = ljust(represented, scenario.feature.max_length + 2) term.write(term.bold_white(represented)) term.writeln(term.color(8)(scenario.location)) if outline: term.writeln(represent_table([outline.keys(), outline.values()], indent=6, cell_wrap=term.white)) term.writeln() # write a preview of the steps if term.is_a_tty: steps_ = [] if scenario.feature.background: steps_ += scenario.feature.background.steps steps_ += steps term.writeln( term.color(8)('\n'.join( step.represented() for step in steps_ ) + '\n'), return_=True ) yield finally: term.writeln()
def example_wrapper(term, scenario, outline, steps): """Display scenario execution.""" try: if scenario.tags: term.writeln(term.cyan(scenario.represent_tags())) start, end = scenario.represented().rsplit('#') term.write(term.bold_white(start)) term.writeln(term.color(8)(end)) if outline: term.writeln(represent_table([outline.keys(), outline.values()], indent=6, cell_wrap=term.white)) term.writeln() # write a preview of the steps if term.is_a_tty: steps_ = [] if scenario.feature.background: steps_ += scenario.feature.background.steps steps_ += steps term.writeln( term.color(8)('\n'.join( step.represented(annotate=False) for step in steps_ ) + '\n'), return_=True ) yield finally: term.writeln()