def test_filebase_init(self): filebase = Filebase( '/tmp/output/%Y/{groups[0]}/{groups[1]}_test_{file_number}_file_') expected_dir = '/tmp/output/2010/{groups[0]}' expected_prefix = '{groups[1]}_test_{file_number}_file_' expected = '/'.join([expected_dir, expected_prefix]) self.assertEqual(filebase.template, expected) self.assertEqual(filebase.prefix_template, expected_prefix) self.assertEqual(filebase.dirname_template, expected_dir)
def setUp(self): self.filebase = Filebase( '/tmp/output/{groups[0]}/{groups[1]}_test_{file_number}_file_')