From 2ecc6d8312fff32d34727c4bb2f5ab20c3eed80d Mon Sep 17 00:00:00 2001 From: Aditya Kumawat Date: Mon, 13 Feb 2023 15:55:11 +0530 Subject: [PATCH] Adds a test to check if an empty table is created from records if the records list is empty (#582) --- tests/test_tables.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_tables.py b/tests/test_tables.py index f0abfbd7f..03dab78b5 100644 --- a/tests/test_tables.py +++ b/tests/test_tables.py @@ -1901,3 +1901,9 @@ def test_read_table(): assert isinstance(Table().read_table("tests/us-unemployment-copy"), Table) assert isinstance(Table().read_table("tests/us-unemployment.txt"), Table) assert isinstance(Table().read_table("https://raw.githubusercontent.com/data-8/textbook/main/assets/data/deflategate.csv"), Table) + +def test_no_records(): + """Test that Table returns nothing on an empty record""" + empty_table = Table() + records_empty_table = Table().from_records([]) + assert empty_table == records_empty_table \ No newline at end of file