summaryrefslogtreecommitdiff
path: root/tests/test_search.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_search.py')
-rw-r--r--tests/test_search.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/test_search.py b/tests/test_search.py
index ecdc550..f126f7e 100644
--- a/tests/test_search.py
+++ b/tests/test_search.py
@@ -1,4 +1,14 @@
+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" \ No newline at end of file
+ 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'