示例#1
0
 def setOffSet(self, setting):
     self.offset = Alphabet.index(setting)
示例#2
0
 def mapOut(self, input):
     inputIndex = Alphabet.index(input)
     outputIndex = (inputIndex - self.offset) % Alphabet.length()
     return Alphabet[outputIndex]
示例#3
0
 def setRingSetting(self, setting):
     self.setting = Alphabet.index(setting)
示例#4
0
 def mapIn(self, input):
     inputIndex = Alphabet.index(input)
     outputIndex = (inputIndex - self.setting) % Alphabet.length()
     return Alphabet[outputIndex]
示例#5
0
def test_turnover_detection(given, expected):
    noopRotor = RotorFactory.Rotor("NoOp")
    noopRotor.turnover = Alphabet.index("C")
    noopRotor.rotorStack.setOffSet(given)
    assert expected == noopRotor.isInTurnoverPosition()