def most_common_passwords(n): try: results = PersonService.most_common('passwords', n) for r in results: print("{}, {}".format(r.login_password, r.occur)) except OperationalError: print('Database is empty please download some persons first')
def test_n_rows_returned_when_most_common_called_with_arg_passwords_n(): n = 5 res = PersonService.most_common('passwords', n) res = list(r for r in res) assert len(res) == n