3 from mediagoblin
import processing
5 class TestProcessing(object):
6 def run_fill(self
, input, format
, output
=None):
7 builder
= processing
.FilenameBuilder(input)
8 result
= builder
.fill(format
)
11 assert output
== result
13 def test_easy_filename_fill(self
):
14 self
.run_fill('/home/user/foo.TXT', '{basename}bar{ext}', 'foobar.txt')
16 def test_long_filename_fill(self
):
17 self
.run_fill('{0}.png'.format('A' * 300), 'image-{basename}{ext}',
18 'image-{0}.png'.format('A' * 245))