Exemplo n.º 1
0
def test_property_lines_mac():
  fp = StringIO('a\rb\rc\r')
  eq_(['a', 'b', 'c'], list(jprops._property_lines(fp)))
Exemplo n.º 2
0
def test_property_lines_skips_comments():
    fp = BytesIO(b'a\nb\n#foo\n!bar\nc\n')
    eq_([b'a', b'b', b'c'], list(jprops._property_lines(fp)))
Exemplo n.º 3
0
def test_property_lines_splitting(lines, expected):
    property_lines = lambda fp: list(jprops._property_lines(fp))
    assert property_lines(BytesIO(lines)) == expected
    assert property_lines(StringIO(lines.decode('ascii'))) == expected
Exemplo n.º 4
0
def test_property_lines_continuation():
  fp = BytesIO(b'a\nb\\\nc\nd\n')
  eq_([b'a', b'bc', b'd'], list(jprops._property_lines(fp)))
Exemplo n.º 5
0
def test_property_lines_escaped_backslash_before_continuation():
  fp = BytesIO(b'a\nb\\\\\\\nc\nd\n')
  eq_([b'a', b'b\\\\c', b'd'], list(jprops._property_lines(fp)))
Exemplo n.º 6
0
def test_property_lines_escaped_backslash_before_continuation():
  fp = StringIO('a\nb\\\\\\\nc\nd\n')
  eq_(['a', 'b\\\\c', 'd'], list(jprops._property_lines(fp)))
Exemplo n.º 7
0
def test_property_lines_mac():
  fp = BytesIO(b'a\rb\rc\r')
  eq_([b'a', b'b', b'c'], list(jprops._property_lines(fp)))
Exemplo n.º 8
0
def test_property_lines_includes_comments():
  fp = BytesIO(b'a\nb\n#foo\n!bar\nc\n')
  assert list(jprops._property_lines(fp)) == [b'a', b'b', b'#foo', b'!bar', b'c']
Exemplo n.º 9
0
def test_property_lines_continuation_includes_trailing_blanks():
  fp = BytesIO(b'a\nb \\\nc\nd\n')
  assert list(jprops._property_lines(fp)) == [b'a', b'b c', b'd']
Exemplo n.º 10
0
def test_property_lines():
    fp = BytesIO(b'a\nb\nc\n')
    eq_([b'a', b'b', b'c'], list(jprops._property_lines(fp)))
Exemplo n.º 11
0
def test_property_lines_mac():
  fp = BytesIO(b'a\rb\rc\r')
  assert list(jprops._property_lines(fp)) == [b'a', b'b', b'c']
Exemplo n.º 12
0
def test_property_lines_escaped_backslash_before_continuation():
    fp = BytesIO(b'a\nb\\\\\\\nc\nd\n')
    eq_([b'a', b'b\\\\c', b'd'], list(jprops._property_lines(fp)))
Exemplo n.º 13
0
def test_property_lines_continuation_skips_leading_blanks():
    fp = BytesIO(b'a\nb\\\n c\nd\n')
    eq_([b'a', b'bc', b'd'], list(jprops._property_lines(fp)))
Exemplo n.º 14
0
def test_property_lines_continuation():
    fp = BytesIO(b'a\nb\\\nc\nd\n')
    eq_([b'a', b'bc', b'd'], list(jprops._property_lines(fp)))
Exemplo n.º 15
0
def test_property_lines_skips_comments():
  fp = StringIO('a\nb\n#foo\n!bar\nc\n')
  eq_(['a', 'b', 'c'], list(jprops._property_lines(fp)))
Exemplo n.º 16
0
def test_property_lines_escaped_backslash_not_continuation():
  fp = BytesIO(b'a\nb\\\\\nc\nd\n')
  assert list(jprops._property_lines(fp)) == [b'a', b'b\\\\', b'c', b'd']
Exemplo n.º 17
0
def test_property_lines_continuation_skips_leading_blanks():
  fp = StringIO('a\nb\\\n c\nd\n')
  eq_(['a', 'bc', 'd'], list(jprops._property_lines(fp)))
Exemplo n.º 18
0
def test_property_lines():
  fp = BytesIO(b'a\nb\nc\n')
  assert list(jprops._property_lines(fp)) == [b'a', b'b', b'c']
Exemplo n.º 19
0
def test_property_lines():
  fp = StringIO('a\nb\nc\n')
  eq_(['a', 'b', 'c'], list(jprops._property_lines(fp)))
Exemplo n.º 20
0
def test_property_lines_platform_line_endings(lines):
  expected = [u'a', u'b', u'c']
  property_lines = lambda fp: list(jprops._property_lines(fp))
  assert property_lines(BytesIO(lines)) == expected
  assert property_lines(StringIO(lines.decode('ascii'))) == expected
Exemplo n.º 21
0
def test_property_lines_skips_comments():
  fp = BytesIO(b'a\nb\n#foo\n!bar\nc\n')
  eq_([b'a', b'b', b'c'], list(jprops._property_lines(fp)))
Exemplo n.º 22
0
def test_property_lines_splitting(lines, expected):
  property_lines = lambda fp: list(jprops._property_lines(fp))
  assert property_lines(BytesIO(lines)) == expected
  assert property_lines(StringIO(lines.decode('ascii'))) == expected
Exemplo n.º 23
0
def test_property_lines_continuation_skips_leading_blanks():
  fp = BytesIO(b'a\nb\\\n c\nd\n')
  eq_([b'a', b'bc', b'd'], list(jprops._property_lines(fp)))
Exemplo n.º 24
0
def test_property_lines_platform_line_endings(lines):
    expected = [u'a', u'b', u'c']
    property_lines = lambda fp: list(jprops._property_lines(fp))
    assert property_lines(BytesIO(lines)) == expected
    assert property_lines(StringIO(lines.decode('ascii'))) == expected
Exemplo n.º 25
0
def test_property_lines():
  fp = BytesIO(b'a\nb\nc\n')
  eq_([b'a', b'b', b'c'], list(jprops._property_lines(fp)))
Exemplo n.º 26
0
def test_property_lines_mac():
    fp = BytesIO(b'a\rb\rc\r')
    eq_([b'a', b'b', b'c'], list(jprops._property_lines(fp)))