Skip to content

Commit 74e9910

Browse files
artemisbetaartemisbeta
authored andcommitted
Updated tests to include 5 char grouping
1 parent 6613da8 commit 74e9910

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from setuptools import setup
22

33
setup(name = 'enigma' ,
4-
version = '1.1.0' ,
4+
version = '1.1.4' ,
55
description = 'Enigma Machine Emulator for Python.' ,
66
url = 'http://github.com/artemis-beta/enigma' ,
77
author = 'Kristian Zarebski' ,

tests/test_enigma3.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ def make_machine():
5050
machine = make_machine()
5151
logger.debug("Encrypting %s", phrase)
5252
result = machine.type_phrase(phrase)
53-
5453
logger.debug("Finding Original")
5554
machine = make_machine()
56-
orig = machine.type_phrase(result)
55+
_out = machine.type_phrase(result).replace(' ', '') # Undo 5 letter grouping
56+
orig = _out[:len(phrase)] # Remove extra added chars in groupings
5757
logger.debug(
5858
"Key '%s'\n -> Running Enigma: Phrase Conversion %s -----> %s ------> %s", key, phrase, result, orig)
5959
logger.debug("Machine type: %s" % machine.type)
60-
assert phrase == orig, "ERROR: Reverse Encryption Does Not Match Original Phrase"
60+
assert phrase == orig, "ERROR: Reverse Encryption '{}' Does Not Match Original Phrase '{}'".format(orig, phrase)
6161

6262
@given(
6363
key=strategies.text(alphabet=string.ascii_uppercase, max_size=10),

0 commit comments

Comments
 (0)