def test_transform(rotor_name, ring_setting, position): ring_setting %= 26 position %= 26 rotor = get_rotor(rotor_name, ring_setting, position) encoding = rotor.initial_encoding assert transform_to_encoding(rotor.transform) == gen_data( encoding, position, ring_setting)
def test_transform(encoding, expected): reflector = Plugboard(encoding) result_encoding = transform_to_encoding(reflector.transform) assert result_encoding == expected
def test_encoding_converters(encoding): transform = encoding_to_transform(encoding) assert isinstance(transform, np.ndarray) assert transform_to_encoding(transform) == encoding
def test_get_reflector(reflector_type, encoding): reflector = get_reflector(reflector_type) result_encoding = transform_to_encoding(reflector.transform) assert result_encoding == encoding
def test_transform(encoding): reflector = Reflector(encoding) result_encoding = transform_to_encoding(reflector.transform) assert result_encoding == encoding