Ejemplo n.º 1
0
def test_lchop_unmatched():
    assert util.lchop("12345", "345") == "12345"
Ejemplo n.º 2
0
 def optionxform(self, key):
     return lchop(key, "POWER_SUPPLY_")
Ejemplo n.º 3
0
def test_lchop_prefixed():
    assert util.lchop("12345", "12") == "345"
Ejemplo n.º 4
0
def test_lchop_no_prefix():
    assert util.lchop("345", "") == "345"
Ejemplo n.º 5
0
 def optionxform(self, key):
     return lchop(key, "POWER_SUPPLY_")
Ejemplo n.º 6
0
def test_lchop_unmatched():
    assert util.lchop("12345", "345") == "12345"
Ejemplo n.º 7
0
def test_lchop_no_prefix():
    assert util.lchop("345", "") == "345"
Ejemplo n.º 8
0
def test_lchop_prefixed():
    assert util.lchop("12345", "12") == "345"
Ejemplo n.º 9
0
def lchop(prefix, string):
    chopped = util.lchop(string, prefix)
    if string.startswith(prefix):
        assert len(chopped) == len(string) - len(prefix)
    assert not (prefix and chopped.startswith(prefix))