def test_escape_unicode(): assert jprops._escape('\x00') == br'\u0000' assert jprops._escape(u'\u0000') == br'\u0000' assert jprops._escape('\x19') == br'\u0019' assert jprops._escape(u'\u0019') == br'\u0019' assert jprops._escape('\x7f') == br'\u007f' assert jprops._escape(u'\u007f') == br'\u007f' assert jprops._escape(u'\uffff') == br'\uffff' assert type(jprops._escape(u'\uffff')) == bytes
def test_escape_unicode(): eq_(br'\u0000', jprops._escape('\x00')) eq_(br'\u0000', jprops._escape(u'\u0000')) eq_(br'\u0019', jprops._escape('\x19')) eq_(br'\u0019', jprops._escape(u'\u0019')) eq_(br'\u007f', jprops._escape('\x7f')) eq_(br'\u007f', jprops._escape(u'\u007f')) eq_(br'\uffff', jprops._escape(u'\uffff')) eq_(bytes, type(jprops._escape(u'\uffff')))
def test_escape_basic(): eq_(b'\\\\', jprops._escape('\\')) eq_(br'\t', jprops._escape('\t')) eq_(br'\n', jprops._escape('\n')) eq_(br'\f', jprops._escape('\f')) eq_(br'\r', jprops._escape('\r'))
def test_escape(value, expected): actual = jprops._escape(value) assert actual == expected assert type(actual) == type(expected)
def test_escape_comment_marker(): assert jprops._escape('#') == br'\#' assert jprops._escape('!') == br'\!'
def test_escape_basic(): assert jprops._escape('\\') == b'\\\\' assert jprops._escape('\t') == br'\t' assert jprops._escape('\n') == br'\n' assert jprops._escape('\f') == br'\f' assert jprops._escape('\r') == br'\r'