예제 #1
0
 def test_DEC2OCT_checkBounds(self):
     self.assertEqual(engineering.DEC2OCT(2**29 - 1),
                      func_xltypes.Text('3777777777'))
     self.assertEqual(engineering.DEC2OCT(-(2**29)),
                      func_xltypes.Text('4000000000'))
     self.assertIsInstance(engineering.DEC2OCT(2**29),
                           xlerrors.NumExcelError)
     self.assertIsInstance(engineering.DEC2OCT(-(2**29) - 1),
                           xlerrors.NumExcelError)
예제 #2
0
def test_dec2oct_with_places(number, places, expected):
    assert_equivalent(engineering.DEC2OCT(number, places), expected)
예제 #3
0
def test_dec2oct(number, expected):
    assert_equivalent(engineering.DEC2OCT(number), expected)
예제 #4
0
 def test_DEC2OCT_withTooManyPlaces(self):
     self.assertIsInstance(engineering.DEC2OCT(8, 1),
                           xlerrors.NumExcelError)
예제 #5
0
 def test_DEC2OCT_withPlaces(self):
     self.assertEqual(engineering.DEC2OCT(8, 5), func_xltypes.Text('00010'))
     self.assertEqual(engineering.DEC2OCT(-1, 1),
                      func_xltypes.Text('7777777777'))
예제 #6
0
 def test_DEC2OCT(self):
     self.assertEqual(engineering.DEC2OCT(8), func_xltypes.Text('10'))
     self.assertEqual(engineering.DEC2OCT(-1),
                      func_xltypes.Text('7777777777'))
     self.assertEqual(engineering.DEC2OCT(-2),
                      func_xltypes.Text('7777777776'))