diff options
author | HombreLaser <buran@silosneeded.com> | 2024-03-12 23:46:02 -0600 |
---|---|---|
committer | HombreLaser <buran@silosneeded.com> | 2024-03-12 23:46:02 -0600 |
commit | a0fcdc83cbc2b440a5836313b2afd1a35698f5ef (patch) | |
tree | 60cf56be85de882b8999d990feaaf2cf4f683dba /tests/conftest.py | |
parent | afd4e795e3a7e7b34e0d3127f11c05c0e7a2fede (diff) |
Añade pruebas
Diffstat (limited to 'tests/conftest.py')
-rw-r--r-- | tests/conftest.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..f3dbc41 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,36 @@ +from src.program import Program +from glob import iglob +import os +import pytest + + +@pytest.fixture +def row_at_program(): + return Program(args=['-f', './tests/test_table.csv', '-c', 'row-at', '2']) + + +@pytest.fixture +def get_rows_program(): + return Program(args=['-f', './tests/test_table.csv', '-c', 'get-rows', '2']) + + +@pytest.fixture +def insert_program(): + return Program(args=['-f', './tests/test_table.csv', '-c', 'insert', '1969,Ubik,Philip K. Dick']) + + +@pytest.fixture +def search_program(): + return Program(args=['-f', './tests/test_table.csv', '-c', 'search', 'Ten Days that Shook the World']) + + +@pytest.fixture +def delete_at_program(): + return Program(args=['-f', './tests/test_table.csv', '-c', 'delete-at', '1']) + + +@pytest.fixture(scope='session', autouse=True) +def delete_created_csv_files(): + yield + for file in iglob("./new_*.csv"): + os.remove(file)
\ No newline at end of file |