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