def test_make_intermediate(self): self.assertEqual(alg.make_intermediate("1234"), "$2y$10$w1dpoPu1duVEV4rnZPAkLe8kxqbSe4xmE4jVqL4IcwVLWluqZNI3G") self.assertEqual(alg.make_intermediate("super secret"), "$2y$10$w1dpoPu1duVEV4rnZPAkLea0PzJXKXtAHtHZ60MWk6pk1GH1uKpSe") self.assertEqual(alg.make_intermediate("blowfish"), "$2y$10$w1dpoPu1duVEV4rnZPAkLefQ9jBvhg/MM6m/oTFbWLBq0R0bhwiVW")
def test_make_intermediate(self): self.assertEqual( alg.make_intermediate("1234"), "$2y$10$w1dpoPu1duVEV4rnZPAkLe8kxqbSe4xmE4jVqL4IcwVLWluqZNI3G") self.assertEqual( alg.make_intermediate("super secret"), "$2y$10$w1dpoPu1duVEV4rnZPAkLea0PzJXKXtAHtHZ60MWk6pk1GH1uKpSe") self.assertEqual( alg.make_intermediate("blowfish"), "$2y$10$w1dpoPu1duVEV4rnZPAkLefQ9jBvhg/MM6m/oTFbWLBq0R0bhwiVW")
def use_master(master_plaintext, use_bcrypt=False): global session_master global session_intermediate session_master = master_plaintext if use_bcrypt: session_intermediate = alg.make_intermediate(session_master) else: session_intermediate = session_master
def test_make_intermediate_too_long(self): with self.assertRaises(Exception): alg.make_intermediate("x" * 73)