'pathrender: _OptionalBlock element processing'

def test_optional(self):

    o = _pr._OptionalBlock([_pr._Replacement(u'$Title'), _pr._LiteralText(u'.foobar')])
    subst = {'$Title': 'foo', '$Track': 'bar'}
    res = o.render(subst)
    self.assertEqual(res, u'foo.foobar', 'check    non-empty    replacement')
    subst = {'$Title': ''}
    res = o.render(subst)
    self.assertEqual(res, '', 'check    empty    replacement')
    subst = {'$Title': None}
    res = o.render(subst)
    self.assertEqual(res, '', 'check    render()    works    with    None')
