예제 #1
0
    def test_strip_spaces(self):
        stripped = loads(INVOICE_CSV_TEXT, strip_spaces=True)
        assert_equal(stripped.BILLING_FIRST,
                     ["Dave", "Rusty", "Jack", "clyde"])
        assert_equal(stripped.BILLING_LAST,
                     ["ormsbee", "ormsbee", "", "ormsbee"])

        not_stripped = loads(INVOICE_CSV_TEXT, strip_spaces=False)
        assert_equal(not_stripped.BILLING_FIRST,
                     ["  Dave", "Rusty", "Jack", " clyde "])
예제 #2
0
    def test_skip_blank_lines(self):
        no_blanks = loads(INVOICE_CSV_TEXT, skip_blank_lines=True)
        assert_equal(no_blanks.num_rows, 4)

        with_blanks = loads(INVOICE_CSV_TEXT, skip_blank_lines=False)
        assert_equal(with_blanks.num_rows, 6)