from src.program import Program def test_search(capsys, search_program): search_program.run() assert capsys.readouterr()[0] == "('1919', 'Ten Days that Shook the World', 'John Reed')\n" def test_failed_search(capsys): Program(args=['-f', './tests/test_table.csv', '-c', 'search', "This book isn't on the table"]).run() assert capsys.readouterr()[0] == 'Not found!\n'