Beispiel #1
0
    def test_named_placeholders(self):
        self.assertEqual('foo __item__ bar',
                         humanize_placeholders('foo %(item)s bar'))
        self.assertEqual('foo __item_name__ bar',
                         humanize_placeholders('foo %(item_name)s bar'))

        self.assertEqual('foo % (item)s bar',
                         humanize_placeholders('foo % (item)s bar'))
Beispiel #2
0
 def test_positional_placeholders(self):
     self.assertEqual('foo __item__ bar',
                      humanize_placeholders('foo %s bar'))
     self.assertEqual('foo __number__ bar',
                      humanize_placeholders('foo %d bar'))
     self.assertEqual('foo __item__ bar __item__',
                      humanize_placeholders('foo %s bar %s'))
     self.assertEqual('foo __item____item__',
                      humanize_placeholders('foo %s%s'))
 def test_positional_placeholders(self):
     self.assertEqual('foo __item__ bar', humanize_placeholders('foo %s bar'))
     self.assertEqual('foo __number__ bar', humanize_placeholders('foo %d bar'))
     self.assertEqual('foo __item__ bar __item__', humanize_placeholders('foo %s bar %s'))
     self.assertEqual('foo __item____item__', humanize_placeholders('foo %s%s'))
    def test_named_placeholders(self):
        self.assertEqual('foo __item__ bar', humanize_placeholders('foo %(item)s bar'))
        self.assertEqual('foo __item_name__ bar', humanize_placeholders('foo %(item_name)s bar'))

        self.assertEqual('foo % (item)s bar', humanize_placeholders('foo % (item)s bar'))