예제 #1
0
def test_apply_js_data():
    """Test that data gets applied properly for JS files."""

    data = {"foo": "test",
            "bar": "mozilla"}

    eq_(p._apply_data("i %(foo)s at %(bar)s", "foo.js", data),
        "i test at mozilla")
예제 #2
0
def test_apply_data():
    """Test that data gets applied properly."""

    data = {"foo": "test",
            "bar": "mozilla"}

    eq_(p._apply_data("i {foo} at {bar}", "foo.xul", data),
        "i test at mozilla")
예제 #3
0
def test_apply_data_empty():
    """Test that applying no data with _apply_data does nothing."""

    eq_(p._apply_data("I {heart} you", "foo.xul"), "I {heart} you")
    eq_(p._apply_data("I %(heart)s you", "foo.js"), "I %(heart)s you")