Use urljoin to create proper feed media URLs
[larjonas-mediagoblin.git] / mediagoblin / tests / test_processing.py
blob591add96924ae75c99def8f61bf0d3cf047fafc5
1 #!/usr/bin/env python
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)
9 if output is None:
10 return result
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))