Exemplo n.º 1
0
def test_listReplace():
    """Ensure replacing a list of items from a string works correctly"""
    myString = "A string of text"
    assert StringUtils.listReplace(myString, ['A', 'text', 'string'],
                                   "AHH") == "AHH AHH of AHH"
    assert StringUtils.listReplace(myString, ['A', 'text', 'string'],
                                   ["1", "2", "3"]) == "1 3 of 2"
Exemplo n.º 2
0
def test_listReplace():
    """Ensure replacing a list of items from a string works correctly"""
    myString = "A string of text"
    assert StringUtils.listReplace(myString, ['A', 'text', 'string'], "AHH") == "AHH AHH of AHH"
    assert StringUtils.listReplace(myString, ['A', 'text', 'string'], ["1", "2", "3"]) == "1 3 of 2"