Example #1
0
 def test_int_or_none(self):
     self.assertEqual(utils.int_or_none(1), 1)
     self.assertEqual(utils.int_or_none('1'), 1)
     self.assertEqual(utils.int_or_none(None), None)
     self.assertRaises(ValueError, utils.int_or_none, 'foo')
Example #2
0
 def test_int_or_none(self):
     self.assertEqual(utils.int_or_none(1), 1)
     self.assertEqual(utils.int_or_none('1'), 1)
     self.assertIsNone(utils.int_or_none(None))
     self.assertRaises(ValueError, utils.int_or_none, 'foo')
Example #3
0
 def test_int_or_none(self):
     self.assertEqual(utils.int_or_none(1), 1)
     self.assertEqual(utils.int_or_none("1"), 1)
     self.assertIsNone(utils.int_or_none(None))
     self.assertRaises(ValueError, utils.int_or_none, "foo")