def test_truncate_str(self): self.assertEqual(utils.truncate('nofloat'), 'nofloat')
def test_truncate_float(self): original_float = 3.232999 truncated_float = utils.truncate(original_float, n=2) self.assertIsInstance(truncated_float, float) self.assertGreater(original_float, truncated_float)