-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
executable file
·59 lines (51 loc) · 1.68 KB
/
test.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
#!/bin/env python
import unittest
from bookland import *
class Test_rgbtocmyk(unittest.TestCase):
'''RGB to CMYK conversion. This only tests the formula,
not the actual color conversion, which can be device dependent.'''
def test_00(self):
self.assertEqual(rgbtocmyk((0,0,0)),(0, 0, 0, 1.))
def test_01(self):
self.assertEqual(rgbtocmyk((0,0,1)),(1., 1., 0, 0))
def test_02(self):
self.assertEqual(rgbtocmyk((0,1,0)),(1., 0, 1., 0))
def test_03(self):
self.assertEqual(rgbtocmyk((0,1,1)),(1., 0, 0, 0))
def test_04(self):
self.assertEqual(rgbtocmyk((1,0,0)),(0, 1., 1., 0))
def test_05(self):
self.assertEqual(rgbtocmyk((1,0,1)),(0, 1., 0, 0))
def test_06(self):
self.assertEqual(rgbtocmyk((1,1,0)),(0, 0, 1., 0))
def test_07(self):
self.assertEqual(rgbtocmyk((1,1,1)),(0, 0, 0, 0))
class Test_colorValOK(unittest.TestCase):
'Not much to look at here'
def test_00(self):
t = (2,0,0)
self.assertFalse(colorValOK(t))
def test_01(self):
t = (-1,0,0)
self.assertFalse(colorValOK(t))
def test_02(self):
t = (2,0,0,0)
self.assertFalse(colorValOK(t))
def test_03(self):
t = (-1,0,0,0)
self.assertFalse(colorValOK(t))
def test_04(self):
t = (1,0,0)
self.assertTrue(colorValOK(t))
def test_05(self):
t = (0,0,0)
self.assertTrue(colorValOK(t))
def test_06(self):
t = (1,0,0,0)
self.assertTrue(colorValOK(t))
def test_07(self):
t = (0,0,0,0)
self.assertTrue(colorValOK(t))
class Test_setfont(unittest.TestCase):
pass
unittest.main()