def test_search_accounts(): try: pw = PasswordGenerator() matches = set() for acct in pw.search_accounts('my'): matches.add(acct.get_name()) assert ' '.join(matches) == 'mybank' except PasswordError as err: assert str(err) == None