def test_mozillaescapemarginspaces(self):
     assert quote.mozillaescapemarginspaces(u" ") == u""
     assert quote.mozillaescapemarginspaces(u"A") == u"A"
     assert quote.mozillaescapemarginspaces(
         u" abc ") == u"\\u0020abc\\u0020"
     assert quote.mozillaescapemarginspaces(
         u"  abc ") == u"\\u0020 abc\\u0020"
Exemple #2
0
 def encode(cls, string, encoding=None):
     """Encode the string"""
     string = quote.java_utf8_properties_encode(string or "")
     string = quote.mozillaescapemarginspaces(string or "")
     return string
Exemple #3
0
 def test_mozillaescapemarginspaces():
     assert quote.mozillaescapemarginspaces(" ") == ""
     assert quote.mozillaescapemarginspaces("A") == "A"
     assert quote.mozillaescapemarginspaces(" abc ") == "\\u0020abc\\u0020"
     assert quote.mozillaescapemarginspaces("  abc ") == "\\u0020 abc\\u0020"
 def test_mozillaescapemarginspaces(self):
     assert quote.mozillaescapemarginspaces(u" ") == u""
     assert quote.mozillaescapemarginspaces(u"A") == u"A"
     assert quote.mozillaescapemarginspaces(u" abc ") == u"\\u0020abc\\u0020"
     assert quote.mozillaescapemarginspaces(u"  abc ") == u"\\u0020 abc\\u0020"
Exemple #5
0
 def encode(cls, string, encoding=None):
     """Encode the string"""
     string = quote.java_utf8_properties_encode(string or u"")
     string = quote.mozillaescapemarginspaces(string or u"")
     return string