Example #1
0
def test_android_roundtrip_quoting():
    specials = ["don't", 'the "thing"']
    for special in specials:
        quoted_special = dtd.quoteforandroid(special)
        unquoted_special = dtd.unquotefromandroid(quoted_special)
        print("special: %r\nquoted: %r\nunquoted: %r\n" %
              (special, quoted_special, unquoted_special))
        assert special == unquoted_special
Example #2
0
def test_android_roundtrip_quoting():
    specials = [
        "don't",
        'the "thing"'
    ]
    for special in specials:
        quoted_special = dtd.quoteforandroid(special)
        unquoted_special = dtd.unquotefromandroid(quoted_special)
        print("special: %r\nquoted: %r\nunquoted: %r\n" % (special,
                                                           quoted_special,
                                                           unquoted_special))
        assert special == unquoted_special
Example #3
0
def test_unquotefromandroid():
    """Test unquoting Android DTD definitions."""
    assert dtd.unquotefromandroid('"Don\\'t show"') == "Don't show"
    assert dtd.unquotefromandroid('"Don\\\'t show"') == "Don't show"
    assert dtd.unquotefromandroid('"Don\\u0027t show"') == "Don't show"
    assert dtd.unquotefromandroid('"A \\"thing\\""') == "A \"thing\""
Example #4
0
def test_unquotefromandroid():
    """Test unquoting Android DTD definitions."""
    assert dtd.unquotefromandroid('"Don\\'t show"') == "Don't show"
    assert dtd.unquotefromandroid('"Don\\\'t show"') == "Don't show"
    assert dtd.unquotefromandroid('"Don\\u0027t show"') == "Don't show"
    assert dtd.unquotefromandroid('"A \\"thing\\""') == 'A "thing"'