def test_formatting(self): fmt = 'The %r jumped %x over the %s' args = ['frog', 'foo', 'elephant'] res = list(safeify_format(fmt, args)) self.assertListEqual( [x.strip('u') for x in res], ["'frog'", 'foo', 'elephant'], )
def test_formatting(self): fmt = 'The %r jumped over the %s' args = ['frog', 'elephant'] res = list(log.safeify_format(fmt, *args)) self.assertListEqual(res, ["'frog'", 'elephant'])
def test_formatting(self): fmt = "The %r jumped over the %s" args = ["frog", "elephant"] res = list(log.safeify_format(fmt, *args)) self.assertListEqual(res, ["'frog'", "elephant"])
def test_safe_format(): fmt = 'The %r jumped %x over the %s' args = ['frog', 'foo', 'elephant'] res = list(safeify_format(fmt, args)) assert [x.strip('u') for x in res] == ["'frog'", 'foo', 'elephant']