def test_iteration(): # xx, xy, xz, ya, yb spg = SantaPasswordGenerator("xx") assert "xy" == spg.iterate() assert "xz" == spg.iterate() assert "ya" == spg.iterate() assert "yb" == spg.iterate() spg = SantaPasswordGenerator("azz") assert "baa" == spg.iterate()
from pswd import SantaPasswordGenerator, ElfPasswordCheck spg = SantaPasswordGenerator("hepxcrrq") while True: pwd = spg.iterate() if ElfPasswordCheck(pwd): print pwd, "VALID" break