def wrap_fixture(self, _break_line_): text_fitter = TextFitter(None, (None, None), None) point_size = 21 line_source, remainder = _LineSource("foo bar"), _LineSource("bar") _break_line_.side_effect = [("foo", remainder), ("bar", _LineSource(""))] return text_fitter, line_source, point_size, remainder
def it_generates_text_remainder_pairs(self): line_source = _LineSource("foo bar baz") expected = ( ("foo", _LineSource("bar baz")), ("foo bar", _LineSource("baz")), ("foo bar baz", _LineSource("")), ) assert all((a == b) for a, b in zip(expected, line_source))
def it_generates_text_remainder_pairs(self): line_source = _LineSource('foo bar baz') expected = ( ('foo', _LineSource('bar baz')), ('foo bar', _LineSource('baz')), ('foo bar baz', _LineSource('')), ) assert all((a == b) for a, b in zip(expected, line_source))
def wrap_fixture(self, _break_line_): text_fitter = TextFitter(None, (None, None), None) point_size = 21 line_source, remainder = _LineSource('foo bar'), _LineSource('bar') _break_line_.side_effect = [ ('foo', remainder), ('bar', _LineSource('')), ] return text_fitter, line_source, point_size, remainder
def it_wraps_lines_to_help_best_fit(self, request): line_source, remainder = _LineSource("foo bar"), _LineSource("bar") _break_line_ = method_mock( request, TextFitter, "_break_line", side_effect=[("foo", remainder), ("bar", _LineSource(""))], ) text_fitter = TextFitter(None, (None, None), None) text_fitter._wrap_lines(line_source, 21) assert _break_line_.call_args_list == [ call(text_fitter, line_source, 21), call(text_fitter, remainder, 21), ]