예제 #1
0
def conf2table(configuration):
    """
    :param configparser.ConfigParser configuration: Configuration
    :return: Table
    :rtype: behave.model.Table
    """
    table = Table(HEADINGS_INI)
    def s2s(s):
        return six.text_type(s, "utf-8") if six.PY2 else s
    for section in configuration.sections():
        for key, value in configuration.items(section):
            table.add_row([s2s(section), s2s(key), s2s(value)])
    return table
예제 #2
0
def conf2table(configuration):
    """
    :param configparser.ConfigParser configuration: Configuration
    :return: Table
    :rtype: behave.model.Table
    """
    table = Table(HEADINGS_INI)

    def s2s(s):
        return six.text_type(s, "utf-8") if six.PY2 else s
    for section in configuration.sections():
        for key, value in configuration.items(section):
            table.add_row([s2s(section), s2s(key), s2s(value)])
    return table
예제 #3
0
 def write_step_module_overview(self, step_definitions):
     assert self.document
     headings = [u"Step Definition", u"Given", u"When", u"Then", u"Step"]
     table = Table(headings)
     step_type_cols = {
         "given": [u"  x", u"  ",  u"  ",  u"  "],
         "when":  [u"  ",  u"  x", u"  ",  u"  "],
         "then":  [u"  ",  u"  ",  u"  x", u"  "],
         "step":  [u"  x", u"  x", u"  x", u"  x"],
     }
     for step_definition in step_definitions:
         row = [self.describe_step_definition(step_definition)]
         row.extend(step_type_cols[step_definition.step_type])
         table.add_row(row)
     self.document.write_table(table)
예제 #4
0
 def write_step_module_overview(self, step_definitions):
     assert self.document
     headings = [u"Step Definition", u"Given", u"When", u"Then", u"Step"]
     table = Table(headings)
     step_type_cols = {
         "given": [u"  x", u"  ", u"  ", u"  "],
         "when": [u"  ", u"  x", u"  ", u"  "],
         "then": [u"  ", u"  ", u"  x", u"  "],
         "step": [u"  x", u"  x", u"  x", u"  x"],
     }
     for step_definition in step_definitions:
         row = [self.describe_step_definition(step_definition)]
         row.extend(step_type_cols[step_definition.step_type])
         table.add_row(row)
     self.document.write_table(table)
 def write_step_module_overview(self, step_definitions):
     assert self.document
     headings = ["Step Definition", "Given", "When", "Then", "Step"]
     table = Table(headings)
     step_type_cols = {
         # -- pylint: disable=bad-whitespace
         "given": ["  x", "  ",  "  ",  "  "],
         "when":  ["  ",  "  x", "  ",  "  "],
         "then":  ["  ",  "  ",  "  x", "  "],
         "step":  ["  x", "  x", "  x", "  x"],
     }
     for step_definition in step_definitions:
         row = [self.describe_step_definition(step_definition)]
         row.extend(step_type_cols[step_definition.step_type])
         table.add_row(row)
     self.document.write_table(table)