Fix Float unittest for Python < 2.6 that doesn't have hex method

This commit is contained in:
Cédric Krier
2010-06-08 07:55:01 +02:00
parent 1346249cc3
commit ee2260c839
+3 -1
View File
@@ -372,7 +372,9 @@ class ProtocolsDatatypeFloatTestCase(unittest.TestCase):
'''
Test float only method
'''
self.assertEqual(Float('1.5').hex(), '0x1.8000000000000p+0')
# For Python < 2.6
if hasattr(float, 'hex'):
self.assertEqual(Float('1.5').hex(), '0x1.8000000000000p+0')
def suite():
return unittest.TestLoader().loadTestsFromTestCase(ProtocolsDatatypeFloatTestCase)