示例#1
0
文件: test_lang.py 项目: Xion/taipan
 def test_string(self):
     with self.assertRaises(TypeError):
         __unit__.ensure_number('')
示例#2
0
 def test_some_object(self):
     with self.assertRaises(TypeError):
         __unit__.ensure_number(object())
示例#3
0
文件: test_lang.py 项目: Xion/taipan
 def test_some_object(self):
     with self.assertRaises(TypeError):
         __unit__.ensure_number(object())
示例#4
0
文件: test_lang.py 项目: Xion/taipan
 def test_float__literal(self):
     __unit__.ensure_number(42.0)
示例#5
0
文件: test_lang.py 项目: Xion/taipan
 def test_complex__ctor(self):
     __unit__.ensure_number(complex())
示例#6
0
文件: test_lang.py 项目: Xion/taipan
 def test_long__ctor(self):
     __unit__.ensure_number(long())
示例#7
0
文件: test_lang.py 项目: Xion/taipan
 def test_long__type(self):
     with self.assertRaises(TypeError):
         __unit__.ensure_number(long)
示例#8
0
 def test_long__type(self):
     with self.assertRaises(TypeError):
         __unit__.ensure_number(long)
示例#9
0
 def test_float__ctor(self):
     __unit__.ensure_number(float())
示例#10
0
 def test_long__ctor(self):
     __unit__.ensure_number(long())
示例#11
0
 def test_long__literal(self):
     __unit__.ensure_number(eval('42L'))
示例#12
0
 def test_int__literal(self):
     __unit__.ensure_number(42)
示例#13
0
 def test_int__ctor(self):
     __unit__.ensure_number(int())
示例#14
0
 def test_string(self):
     with self.assertRaises(TypeError):
         __unit__.ensure_number('')
示例#15
0
文件: test_lang.py 项目: Xion/taipan
 def test_int__ctor(self):
     __unit__.ensure_number(int())
示例#16
0
 def test_float__literal(self):
     __unit__.ensure_number(42.0)
示例#17
0
文件: test_lang.py 项目: Xion/taipan
 def test_int__literal(self):
     __unit__.ensure_number(42)
示例#18
0
 def test_float__type(self):
     with self.assertRaises(TypeError):
         __unit__.ensure_number(float)
示例#19
0
文件: test_lang.py 项目: Xion/taipan
 def test_long__literal(self):
     __unit__.ensure_number(eval('42L'))
示例#20
0
 def test_complex__ctor(self):
     __unit__.ensure_number(complex())
示例#21
0
文件: test_lang.py 项目: Xion/taipan
 def test_float__ctor(self):
     __unit__.ensure_number(float())
示例#22
0
 def test_complex__type(self):
     with self.assertRaises(TypeError):
         __unit__.ensure_number(complex)
示例#23
0
文件: test_lang.py 项目: Xion/taipan
 def test_float__type(self):
     with self.assertRaises(TypeError):
         __unit__.ensure_number(float)
示例#24
0
文件: test_lang.py 项目: Xion/taipan
 def test_none(self):
     with self.assertRaises(TypeError):
         __unit__.ensure_number(None)
示例#25
0
文件: test_lang.py 项目: Xion/taipan
 def test_complex__type(self):
     with self.assertRaises(TypeError):
         __unit__.ensure_number(complex)
示例#26
0
 def test_none(self):
     with self.assertRaises(TypeError):
         __unit__.ensure_number(None)