From d4d62c6efb5f22c4a935a0a5feb6ec13b7c82f2b Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Wed, 13 Mar 2024 19:53:36 -0600 Subject: Add missing tests --- tests/test_insert.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'tests/test_insert.py') diff --git a/tests/test_insert.py b/tests/test_insert.py index caaf7ff..384ae49 100644 --- a/tests/test_insert.py +++ b/tests/test_insert.py @@ -1,4 +1,16 @@ +from src.program import Program +from src.exceptions import IncompatibleRowLengthError +import pytest + + def test_insert(capsys, insert_program): insert_program.run() - assert capsys.readouterr()[0] == 'Row added!\n' \ No newline at end of file + assert capsys.readouterr()[0] == 'Row added!\n' + + +def test_out_of_bounds_insert(capsys): + Program(args=['-f', './tests/test_table.csv', '-c', 'insert', '1,2,3,4']).run() + + assert capsys.readouterr()[0] == 'Incompatible row length, got 4, expected 3\n' + -- cgit v1.2.3