# Path: test/_common.py
# def print_test_result(expected, actual, error=None):
#     print(f"[expected]\n{expected}\n")
#     print(f"[actual]\n{actual}\n")
# 
#     if error:
#         print(error, file=sys.stderr)
# 
#     print("----------------------------------------")
# 
# Path: test/data.py
# TIME = datetime.datetime(2017, 1, 1, 0, 0, 0)
# INF = float("inf")
# NAN = float("nan")


import collections
import itertools
import json
import pytest
import pytablewriter as ptw
from decimal import Decimal
from textwrap import dedent
from ..._common import print_test_result
from ...data import float_header_list, float_value_matrix, headers, value_matrix
            {"a": 0.01, "b": 0.00125, "c": 0},
            {"a": 1, "b": 99.9, "c": 0.01},
            {"a": 1.2, "b": 999999.123, "c": 0.001},
        ],
    ),
]
exception_test_data_list = [
    Data(header=header, value=value, expected_list=ptw.EmptyTableDataError)
    for header, value in itertools.product([None, [], ""], [None, [], ""])
] + [Data(header=None, value=value_matrix, expected_list=ValueError)]
table_writer_class = ptw.JsonLinesTableWriter


class Test_JsonLinesTableWriter_write_new_line:
    def test_normal(self, capsys):
        writer = table_writer_class()
        writer.write_null_line()

        out, _err = capsys.readouterr()
        assert out == "\n"


class Test_JsonLinesTableWriter_write_table:
    @pytest.mark.parametrize(
        ["header", "value", "expected_list"],
        [[data.header, data.value, data.expected_list] for data in normal_test_data_list],
    )
    def test_normal(self, capsys, header, value, expected_list):
        writer = table_writer_class()
        writer.headers = header

# Path: test/_common.py
# def print_test_result(expected, actual, error=None):
#     print(f"[expected]\n{expected}\n")
#     print(f"[actual]\n{actual}\n")
# 
#     if error:
#         print(error, file=sys.stderr)
# 
#     print("----------------------------------------")
# 
# Path: test/data.py
# TIME = datetime.datetime(2017, 1, 1, 0, 0, 0)
# INF = float("inf")
# NAN = float("nan")


# Path: test/writer/text/test_jsonlines_writer.py
import collections
import itertools
import json
import pytest
import pytablewriter as ptw
from decimal import Decimal
from textwrap import dedent
from ..._common import print_test_result
from ...data import float_header_list, float_value_matrix, headers, value_matrix

            {"a": 0.01, "b": 0.00125, "c": 0},
            {"a": 1, "b": 99.9, "c": 0.01},
            {"a": 1.2, "b": 999999.123, "c": 0.001},
        ],
    ),
]
exception_test_data_list = [
    Data(header=header, value=value, expected_list=ptw.EmptyTableDataError)
    for header, value in itertools.product([None, [], ""], [None, [], ""])
] + [Data(header=None, value=value_matrix, expected_list=ValueError)]
table_writer_class = ptw.JsonLinesTableWriter


class Test_JsonLinesTableWriter_write_new_line:
    def test_normal(self, capsys):
        writer = table_writer_class()
        writer.write_null_line()

        out, _err = capsys.readouterr()
        assert out == "\n"


class Test_JsonLinesTableWriter_write_table:
    @pytest.mark.parametrize(
        ["header", "value", "expected_list"],
        [[data.header, data.value, data.expected_list] for data in normal_test_data_list],
    )
    def test_normal(self, capsys, header, value, expected_list):
        writer = table_writer_class()
        writer.headers = header

        writer.value_matrix = value