Example #1
0
    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))
Example #2
0
    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))
Example #3
0
 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)