Пример #1
0
def test_ignore_private_as_tsv():
    item = Item()
    item._zero = "to be removed"
    item.one = "one value"
    item._two = "should be removed"
    item.two = "two value"
    item._three = "three"

    assert item.tsv == ("one\ttwo\n" "one value\ttwo value\n")
Пример #2
0
def test_ignore_private_as_json():
    item = Item()
    item._zero = "to be removed"
    item.one = "one value"
    item._two = "should be removed"
    item.two = "two value"
    item._three = "three"

    data = item.json
    assert data == ('{"one":"one value","two":"two value"}')
Пример #3
0
def test_ignore_private_as_csv():
    item = Item()
    item._zero = "to be removed"
    item.one = "one value"
    item._two = "should be removed"
    item.two = "two value"
    item._three = "three"

    data = item.csv
    assert data == ('"one","two"\r\n' '"one value","two value"\r\n')