예제 #1
0
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
예제 #2
0
파일: test_jprops.py 프로젝트: kpb/jprops
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')))
예제 #3
0
파일: test_jprops.py 프로젝트: kpb/jprops
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')))
예제 #4
0
파일: test_jprops.py 프로젝트: kpb/jprops
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'))
예제 #5
0
def test_escape(value, expected):
    actual = jprops._escape(value)
    assert actual == expected
    assert type(actual) == type(expected)
예제 #6
0
def test_escape(value, expected):
  actual = jprops._escape(value)
  assert actual == expected
  assert type(actual) == type(expected)
예제 #7
0
def test_escape_comment_marker():
  assert jprops._escape('#') == br'\#'
  assert jprops._escape('!') == br'\!'
예제 #8
0
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'
예제 #9
0
파일: test_jprops.py 프로젝트: kpb/jprops
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'))