Esempio n. 1
0
def test_line_decorated_with_small_width():
    """
    Test that line() returns empty string if decorated True but line width less than 2.

    Example: width = 1  => ""
    """
    assert calculator.line(1, decorated=True) == ""
Esempio n. 2
0
def test_line_not_decorated():
    """
    Test that line() returns a line of given width, without end "<" and start ">" if decorated is False.

    Example: width = 6  => "------"
    """
    assert calculator.line(7, decorated=False) == "-------"
Esempio n. 3
0
def test_line_one_length():
    """
    Test that line() returns just one line if inserted line width is 1.

    Example: width = 1  => "-"
    """
    assert calculator.line(1) == "-"
Esempio n. 4
0
def test_line_decorated():
    """
    Test that line() returns a line of given width with ">" at the start and "<" in the end, if decorated is True.

    Example: width = 6  => ">----<"
    """
    assert calculator.line(6, decorated=True) == ">----<"
Esempio n. 5
0
def test_line_zero_length():
    """
    Test that line() returns an empty string if inserted line width is 0.

    Example: width = 0  => ""
    """
    assert calculator.line(0) == ""