Example #1
0
def test_edit():
    b = Buffer()
    base_file = "tests/test_buffer.py"
    b.edit(base_file)
    expected = [x.rstrip() for x in open(base_file).readlines()]
    assert b.lines == expected
    assert b.file_name == base_file
Example #2
0
def test_append():
    b = Buffer()
    b.append("This is a test.")
    assert b.lines[0] == "This is a test."
    b.append("a", address=0)
    assert b.lines[0] == "a"
    b.append("1", 1)
    assert b.lines[1] == "1"
Example #3
0
def test_append():
    b = Buffer()
    b.append("This is a test.")
    assert b.lines[0] == "This is a test."
    b.append("a", address=0)
    assert b.lines[0] == "a"
    b.append("1", 1)
    assert b.lines[1] == "1"
Example #4
0
def test_mark():
    b = Buffer()
Example #5
0
def test_join():
    b = Buffer()
Example #6
0
def test_insert():
    b = Buffer()
Example #7
0
def test_file():
    b = Buffer()
    base_file = "tests/test_buffer.py"
    b.file(base_file)
    assert b.file_name == base_file
Example #8
0
def test_subst():
    b = Buffer()
Example #9
0
def test_print():
    b = Buffer()
    b.print(0, 0)
Example #10
0
def test_delete():
    b = Buffer()
Example #11
0
def test_change():
    b = Buffer()
Example #12
0
def test_write():
    b = Buffer()
    b.file("tests/out.txt")
    b.write()
    assert os.path.exists("tests/out.txt")
Example #13
0
def test_print():
    b = Buffer()
    b.print(0,0)
Example #14
0
def test_nprint():
    b = Buffer()
    b.nprint(0,0)
Example #15
0
def test_move():
    b = Buffer()
Example #16
0
def test_nprint():
    b = Buffer()
    b.nprint(0, 0)
Example #17
0
def test_file():
    b = Buffer()
    base_file = "tests/test_buffer.py"
    b.file(base_file)
    assert b.file_name == base_file
Example #18
0
def test_read():
    b = Buffer()
Example #19
0
def test_glob():
    b = Buffer()
Example #20
0
def test_write():
    b = Buffer()
    b.file("tests/out.txt")
    b.write()
    assert os.path.exists("tests/out.txt")
Example #21
0
def test_edit():
    b = Buffer()
    base_file = "tests/test_buffer.py"
    b.edit(base_file)
    assert b.lines == open(base_file).readlines()
    assert b.file_name == base_file