Пример #1
0
    def max_length(self):
        """
        The max length of the feature, description and child blocks
        """

        return max(
            0,
            strings.get_terminal_width(self.represented(annotate=False)),
            *[strings.get_terminal_width(line)
              for line in self.represent_hashes().splitlines()]
        )
Пример #2
0
 def max_length(self):
     try:
         return max(strings.get_terminal_width(
             self.represent_line(n, annotate=False))
             for n, _ in enumerate(self.lines))
     except ValueError:
         return 0
Пример #3
0
def test_column_width_w_number_and_char():
    """strings.column_width_w_number_and_char"""

    assert_equals(
        strings.get_terminal_width(u"%s%c" % (u"4209", 0x4209)),
        6
    )
Пример #4
0
def test_column_width():
    """strings.column_width"""

    assert_equals(
        strings.get_terminal_width(u"あいうえお"),
        10
    )
Пример #5
0
    def max_length(self):
        """
        The max length of the feature, description and child blocks
        """

        return max(
            0,
            strings.get_terminal_width(
                self.represented(annotate=False, description=False)),
            self.description_node.max_length,
            *[scenario.max_length for scenario in self.scenarios]
        )