-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_line.py
62 lines (45 loc) · 1.35 KB
/
test_line.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import pytest
import tga
import line
@pytest.fixture
def image():
return tga.CoordinateImage(100, 100)
def test_line_1(image):
red = (255, 0, 0)
line.line_1(13, 20, 80, 40, image, red)
image.save("line_1")
def test_line_2(image):
red = (255, 0, 0)
white = (255, 255, 255)
line.line_2(13, 20, 80, 40, image, white)
line.line_2(20, 13, 40, 80, image, red)
line.line_2(80, 40, 13, 20, image, red)
image.save("line_2")
def test_line_3(image):
red = (255, 0, 0)
white = (255, 255, 255)
line.line_3(13, 20, 80, 40, image, white)
line.line_3(20, 13, 40, 80, image, red)
line.line_3(80, 40, 13, 20, image, red)
image.save("line_3")
def test_line_4(image):
red = (255, 0, 0)
white = (255, 255, 255)
line.line_4(13, 20, 80, 40, image, white)
line.line_4(20, 13, 40, 80, image, red)
line.line_4(80, 40, 13, 20, image, red)
image.save("line_4")
def test_line_5(image):
red = (255, 0, 0)
white = (255, 255, 255)
line.line_5(13, 20, 80, 40, image, white)
line.line_5(20, 13, 40, 80, image, red)
line.line_5(80, 40, 13, 20, image, red)
image.save("line_5")
@pytest.fixture
def image_1():
return tga.CoordinateImage(800, 800)
def test_line_5_1(image_1):
white = (255, 255, 255)
line.line_5(400, 799, 400, 800, image_1, white)
image_1.save("line_5")