def test_add_photo(): canvas = Canvas() canvas._width = 100 canvas._height = 150 canvas._photos = 5 canvas._map = {(0,0): "None", (0,50): "None", (0,100): "None", (0,150): "None", (50,0): "None", (50,50): "None", (50,100): "None", (50,150): "None", (100,0): "None", (100,50): "None", (100,100): "None", (100,150): "None"} canvas.add_photo((0,20), (90, 80), "P_06") assert canvas._photos == 6 assert canvas._map == {(0,0): "P_06", (0,50): "P_06", (0,100): "None", (0,150): "None", (50,0): "P_06", (50,50): "P_06", (50,100): "None", (50,150): "None", (100,0): "None", (100,50): "None", (100,100): "None", (100,150): "None"}
def test_photo_name(): canvas = Canvas() canvas._photos = 5 result = canvas._gen_name() assert result == "P_05"