-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_modify.py
More file actions
66 lines (55 loc) · 1.69 KB
/
test_modify.py
File metadata and controls
66 lines (55 loc) · 1.69 KB
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
63
64
65
66
from modify import Bitmap
def test_new_file_path():
"""
Can create new file path with mod type
"""
mod_type = '_grayscale'
tiger = Bitmap('./assets/tiger.bmp')
actual = tiger.new_file_path(mod_type)
expected = './assets/tiger_grayscale.bmp'
assert expected == actual
def test_make_grayscale():
"""
Can transform image with grayscale
"""
tiger = Bitmap('./assets/tiger.bmp')
actual = tiger.make_grayscale()
expected_path = './assets/tiger_grayscale.bmp'
assert actual[1] != tiger.img
assert actual[0] == expected_path
def test_flip_horizontal():
"""
Can transform image with flip horizontal
"""
tiger = Bitmap('./assets/tiger.bmp')
actual = tiger.flip_horizontal()
expected_path = './assets/tiger_horizontal.bmp'
assert actual[1] != tiger.img
assert actual[0] == expected_path
def test_flip_vertical():
"""
Can transform image with flip vertical
"""
tiger = Bitmap('./assets/tiger.bmp')
actual = tiger.flip_vertical()
expected_path = './assets/tiger_vertical.bmp'
assert actual[1] != tiger.img
assert actual[0] == expected_path
def test_invert_colors():
"""
Can transform image with invert colors
"""
tiger = Bitmap('./assets/tiger.bmp')
actual = tiger.invert_colors()
expected_path = './assets/tiger_invert.bmp'
assert actual[1] != tiger.img
assert actual[0] == expected_path
def test_make_thumbnail():
"""
Can transform image into a thumbnail
"""
tiger = Bitmap('./assets/tiger.bmp')
actual = tiger.make_thumbnail()
expected_path = './assets/tiger_thumbnail.bmp'
assert actual[1] != tiger.img
assert actual[0] == expected_path