def choose_best_test(): analyzer = EnglishAnalyzer() secret_password = 23 plaintext = "A dyslexic man walks into a bra." ciphertext = single_byte_xor(plaintext, 23) potential_plaintexts = ( single_byte_xor(ciphertext, i) for i in range(255) ) assert analyzer.choose_best(potential_plaintexts)[0] == plaintext
def choose_best_test(): analyzer = EnglishAnalyzer() secret_password = 23 plaintext = "A dyslexic man walks into a bra." ciphertext = single_byte_xor(plaintext, 23) potential_plaintexts = (single_byte_xor(ciphertext, i) for i in range(255)) assert analyzer.choose_best(potential_plaintexts)[0] == plaintext