def test_str_or_none(self): class Obj(object): pass self.assertEqual(utils.str_or_none('foo'), 'foo') self.assertEqual(utils.str_or_none(1), '1') self.assertIsNone(utils.str_or_none(None))
def test_str_or_none(self): class Obj(object): pass self.assertEqual(utils.str_or_none("foo"), "foo") self.assertEqual(utils.str_or_none(1), "1") self.assertIsNone(utils.str_or_none(None))
def test_str_or_none(self): class Obj(object): pass self.assertEqual(utils.str_or_none('foo'), 'foo') self.assertEqual(utils.str_or_none(1), '1') self.assertEqual(utils.str_or_none(None), None)