-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
48 lines (38 loc) · 1.21 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
import unittest
import theeasytype
from the import *
the.use(theeasytype)
class TestTheEasytype(unittest.TestCase):
def setUp(self):
self.r = self.assertRaises
self.true = self.assertTrue
def test_int(self):
self.true(the(1).should.be.int)
with self.r(AssertionError):
the("").should.be.int
def test_float(self):
self.true(the(1.1).should.be.float)
with self.r(AssertionError):
the("").should.be.float
def test_str(self):
self.true(the("").should.be.str)
with self.r(AssertionError):
the(()).should.be.str
def test_list(self):
self.true(the([]).should.be.list)
with self.r(AssertionError):
the("").should.be.list
def test_tuple(self):
self.true(the(()).should.be.tuple)
with self.r(AssertionError):
the("").should.be.tuple
def test_dict(self):
self.true(the({}).should.be.dict)
with self.r(AssertionError):
the("").should.be.dict
def test_set(self):
self.true(the(set()).should.be.set)
with self.r(AssertionError):
the("").should.be.set
if __name__ == '__main__':
unittest.main()