Stop using str.format
On Python 2.6, it requires the format placeholder to have explicit index of argument, so using % formatting is easier. There are a couple places where the method is still used because the same argument is used twice. Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
b55f8abd29
commit
b634a18a7f
14 changed files with 110 additions and 106 deletions
|
|
@ -204,11 +204,11 @@ class TestFindOldCompose(unittest.TestCase):
|
|||
|
||||
class TestHelpers(PungiTestCase):
|
||||
def test_process_args(self):
|
||||
self.assertEqual(util.process_args('--opt={}', None), [])
|
||||
self.assertEqual(util.process_args('--opt={}', []), [])
|
||||
self.assertEqual(util.process_args('--opt={}', ['foo', 'bar']),
|
||||
self.assertEqual(util.process_args('--opt=%s', None), [])
|
||||
self.assertEqual(util.process_args('--opt=%s', []), [])
|
||||
self.assertEqual(util.process_args('--opt=%s', ['foo', 'bar']),
|
||||
['--opt=foo', '--opt=bar'])
|
||||
self.assertEqual(util.process_args('--opt={}', 'foo'), ['--opt=foo'])
|
||||
self.assertEqual(util.process_args('--opt=%s', 'foo'), ['--opt=foo'])
|
||||
|
||||
def test_makedirs(self):
|
||||
util.makedirs(self.topdir + '/foo/bar/baz')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue