def list_persons(count): print("Reading persons") try: persons = PersonService.get_persons(count) for p in persons: print(p.name_first, p.name_last, p.gender, p.dob_age) except OperationalError: print('Database is empty please download some persons first')
def test_n_rows_returned_when_get_persons_with_arg_n_called(): n = 2 res = PersonService.get_persons(n) res = list(r for r in res) assert len(res) == n