コード例 #1
0
def test_ignore_private_as_primitive():
    entry = Entry()
    entry._zero = "to be removed"
    entry.one = "one value"
    entry._two = "should be removed"
    entry.two = "two value"
    entry._three = "three"

    data = entry.primitive
    assert data == ({"one": "one value", "two": "two value"})
コード例 #2
0
def test_ignore_private_as_csv():
    entry = Entry()
    entry._zero = "to be removed"
    entry.one = "one value"
    entry._two = "should be removed"
    entry.two = "two value"
    entry._three = "three"

    data = entry.csv
    assert data == ('"one","two"\r\n' '"one value","two value"\r\n')
コード例 #3
0
def test_ignore_private_as_tsv():
    entry = Entry()
    entry._zero = "to be removed"
    entry.one = "one value"
    entry._two = "should be removed"
    entry.two = "two value"
    entry._three = "three"

    assert entry.tsv == (
        'one\ttwo\n'
        'one value\ttwo value\n'
    )