# 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 datetime
import json
import elasticsearch
import pytest
import pytablewriter as ptw
from decimal import Decimal
from .._common import print_test_result
from ..data import headers, value_matrix
            },
        ]

        print_test_result(expected=expected_body, actual=body)
        assert body == expected_body


class Test_ElasticsearchWriter_write_table:
    @pytest.mark.parametrize(
        ["table", "header", "value", "expected"],
        [[data.table, data.header, data.value, data.expected] for data in empty_test_data_list],
    )
    def test_smoke_empty(self, table, header, value, expected):
        writer = table_writer_class()
        writer.stream = elasticsearch.Elasticsearch()
        writer.table_name = table
        writer.headers = header
        writer.value_matrix = value

        writer.write_table()

    @pytest.mark.parametrize(
        ["table", "header", "value", "expected"],
        [[data.table, data.header, data.value, data.expected] for data in exception_test_data_list],
    )
    def test_exception(self, table, header, value, expected):
        writer = table_writer_class()
        writer.stream = elasticsearch.Elasticsearch()
        writer.table_name = table
        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/test_elasticsearch_writer.py
import collections
import datetime
import json
import elasticsearch
import pytest
import pytablewriter as ptw
from decimal import Decimal
from .._common import print_test_result
from ..data import headers, value_matrix

            },
        ]

        print_test_result(expected=expected_body, actual=body)
        assert body == expected_body


class Test_ElasticsearchWriter_write_table:
    @pytest.mark.parametrize(
        ["table", "header", "value", "expected"],
        [[data.table, data.header, data.value, data.expected] for data in empty_test_data_list],
    )
    def test_smoke_empty(self, table, header, value, expected):
        writer = table_writer_class()
        writer.stream = elasticsearch.Elasticsearch()
        writer.table_name = table
        writer.headers = header
        writer.value_matrix = value

        writer.write_table()

    @pytest.mark.parametrize(
        ["table", "header", "value", "expected"],
        [[data.table, data.header, data.value, data.expected] for data in exception_test_data_list],
    )
    def test_exception(self, table, header, value, expected):
        writer = table_writer_class()
        writer.stream = elasticsearch.Elasticsearch()
        writer.table_name = table
        writer.headers = header

        writer.value_matrix = value