Ejemplo n.º 1
0
 def call_FUT(self, filename, variables):
     from mrbob.rendering import render_filename
     return render_filename(filename, variables)
Ejemplo n.º 2
0
def test_missing_key():
    with raises(KeyError):
        render_filename('foo+bar+blub', dict())
Ejemplo n.º 3
0
def test_no_substitution():
    assert render_filename('foobar',
        dict(foo='127.0.0.1')) == 'foobar'
Ejemplo n.º 4
0
def test_single_plus_not_substituted():
    assert render_filename('foo+bar',
        dict(foo='127.0.0.1',
            bar='em0')) == 'foo+bar'
Ejemplo n.º 5
0
def test_multiple_filename_substitution():
    assert render_filename('+device+_+ip_addr+.conf',
        dict(ip_addr='127.0.0.1',
            device='em0')) == 'em0_127.0.0.1.conf'
Ejemplo n.º 6
0
def test_filename_substitution():
    assert render_filename('em0_+ip_addr+.conf',
        dict(ip_addr='127.0.0.1')) == 'em0_127.0.0.1.conf'