예제 #1
0
def test_context_can_expand_variable():
    context = Context()
    
    context.variables["some"] = "value"
    
    expected = "just value"
    actual = context.expand_variable("just $some") 
    assert actual == expected, "Expected %s Actual %s" % (expected, actual)
예제 #2
0
def test_context_returns_imediately_on_null_variable():
    context = Context()
    assert not context.expand_variable("")
예제 #3
0
def test_context_does_not_replace_variable_if_two_variable_signs_found():
    context = Context()
    context.variables["some"] = "value"
    assert context.expand_variable("$$some") == "$some"
예제 #4
0
def test_context_does_not_expand_unknown_variables():
    context = Context()
    assert context.expand_variable("$some") == "$some"