def represented(self): length = self.max_length + 1 filename = self.described_at.file line = self.described_at.line head = strings.rfill(self.get_head(), length, append=u"# %s:%d\n" % (filename, line)) for description, line in zip(self.description.splitlines(), self.described_at.description_at): head += strings.rfill(u" %s" % description, length, append=u"# %s:%d\n" % (filename, line)) return head
def represent_string(self, string): where = self.described_at if FeatureLoader.step_number: head = ' ' * self.indentation + '%3d'%where.idx + '. ' + string else: head = ' ' * self.indentation + string if self.defined_at: where = self.defined_at head = strings.split_string_with_lines(head, ' ' * (self.indentation + 8)) if FeatureLoader.show_filenames: return strings.rfill(head[0], self.scenario.feature.max_length + 1, append=u'# %s:%d\n' % (where.file, where.line)), head[1] return strings.rfill(head[0], self.scenario.feature.max_length + 1, append=u'\n'), head[1]
def represent_string(self, string): head = ' ' * self.indentation + string where = self.described_at if self.defined_at: where = self.defined_at return strings.rfill(head, self.parent.feature.max_length + 1, append=u'# %s:%d\n' % (where.file, where.line))
def represented(self): head = self._get_head() return strings.rfill(head, self.feature.max_length + 1, append=u'# %s:%d\n' % (self.described_at.file, self.described_at.line))
def represented(self): make_prefix = lambda x: u"%s%s: " % (u' ' * self.indentation, x) if self.outlines: prefix = make_prefix(self.language.first_of_scenario_outline) else: prefix = make_prefix(self.language.first_of_scenario) head_parts = [] if self.tags: tags = ['@%s' % t for t in self.tags] head_parts.append(u' ' * self.indentation) head_parts.append(' '.join(tags) + '\n') head_parts.append(prefix + self.name) head = ''.join(head_parts) appendix = '' if self.described_at: fmt = (self.described_at.file, self.described_at.line) appendix = u'# %s:%d\n' % fmt max_length = self.max_length if self.feature: max_length = self.feature.max_length return strings.rfill( head, max_length + 1, append=appendix)
def represented(self): make_prefix = lambda x: u"%s%s: " % (u' ' * self.indentation, x) if self.outlines: prefix = make_prefix(self.language.first_of_scenario_outline) else: prefix = make_prefix(self.language.first_of_scenario) head_parts = [] if self.tags: tags = ['@%s' % t for t in self.tags] head_parts.append(u' ' * self.indentation) head_parts.append(' '.join(tags) + '\n') head_parts.append(prefix + self.name) head = ''.join(head_parts) appendix = '' if self.described_at: fmt = (self.described_at.file, self.described_at.line) appendix = u'# %s:%d\n' % fmt max_length = self.max_length if self.feature: max_length = self.feature.max_length return strings.rfill(head, max_length + 1, append=appendix)
def represented(self): make_prefix = lambda x: u"%s%s: " % (u' ' * self.indentation, x) if self.outlines: prefix = make_prefix(self.language.first_of_scenario_outline) else: prefix = make_prefix(self.language.first_of_scenario) head = prefix + self.name return strings.rfill(head, self.feature.max_length + 1, append=u'# %s:%d\n' % (self.described_at.file, self.described_at.line))
def represented(self): make_prefix = lambda x: u"%s%s: " % (u' ' * self.indentation, x) if self.outlines: prefix = make_prefix(self.language.first_of_scenario_outline) else: prefix = make_prefix(self.language.first_of_scenario) head = prefix + self.name if len(self.tags) > 0: head = make_prefix("@" + " @".join(self.tags)) + "\n" + head return strings.rfill(head, self.feature.max_length + 1, append=u'# %s:%d\n' % (self.described_at.file, self.described_at.line))
def test_rfill_simple(): "strings.rfill simple case" assert_equals( strings.rfill("ab", 10, "-"), "ab--------" )
def represent_string(self, string): head = " " * self.indentation + string where = self.described_at if self.defined_at: where = self.defined_at return strings.rfill(head, self.scenario.feature.max_length + 1, append=u"# %s:%d\n" % (where.file, where.line))
def test_rfill_append(): "strings.rfill append" assert_equals( strings.rfill("ab", 10, append="# path/to/file.extension: 2"), "ab # path/to/file.extension: 2" )
def test_rfill_full(): "strings.rfill full" assert_equals( strings.rfill("abcdefghij", 10, "|"), "abcdefghij" )
def test_rfill_blank(): "strings.rfill blank" assert_equals( strings.rfill(" ", 10, "|"), " |||||||||" )
def test_rfill_empty(): "strings.rfill empty" assert_equals( strings.rfill("", 10, "*"), "**********" )