Пример #1
0
def test_prepend_gap():
    f = Font()
    f[33] = "!"
    f[20] = "@"
    assert f[33] == "!"
    assert f[20] == "@"
    assert f.start == 20
    assert len(f.ascii) == 33 - 20 + 1
Пример #2
0
def test_prepend_1():
    f = Font()
    f[33] = "!"
    f[32] = "@"
    assert f[33] == "!"
    assert f[32] == "@"
    assert f.start == 32
    assert len(f.ascii) == 2
Пример #3
0
def test_append_gap():
    f = Font()
    f[33] = "!"
    f[40] = "@"
    assert f[33] == "!"
    assert f[40] == "@"
    assert f.start == 33
    assert len(f.ascii) == 40 - 33 + 1
Пример #4
0
def test_append_1():
    f = Font()
    f[33] = "!"
    f[34] = "@"
    assert f[33] == "!"
    assert f[34] == "@"
    assert f.start == 33
    assert len(f.ascii) == 2
Пример #5
0
def test_unicode():
    f = Font()
    f[33] = "!"
    f[200] = "@"
    assert f[33] == "!"
    assert f[200] == "@"
    assert f.start == 33
    assert len(f.ascii) == 1
    assert len(f.unicode) == 1
Пример #6
0
def test_contains():
    f = Font()
    assert not 20 in f
    f[33] = "!"
    f[40] = "@"
    assert 33 in f
    assert 40 in f
    assert not 20 in f
    assert not -2 in f
    assert not 35 in f
    assert not 50 in f
    assert not 500 in f
Пример #7
0
def test_get():
    f = Font()
    assert f[20] == None
    f[33] = "!"
    f[40] = "@"
    assert f[33] == "!"
    assert f[40] == "@"
    assert f[20] == None
    assert f[-2] == None
    assert f[35] == None
    assert f[50] == None
    assert f[500] == None
Пример #8
0
def test_add_empty():
    f = Font()
    f[33] = "!"
    assert f[33] == "!"
    assert f.start == 33
    assert len(f.ascii) == 1