summaryrefslogtreecommitdiff
path: root/tests/test_search.py
blob: f126f7e13f70bc41594dffeabac61b6a7e068af0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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"


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'