Skip to content

Instantly share code, notes, and snippets.

@samwhitehall
Forked from nathanwilson/ERROR OUTPUT
Last active August 17, 2017 10:20
Show Gist options
  • Save samwhitehall/eed867f4e23310c36dad to your computer and use it in GitHub Desktop.
Save samwhitehall/eed867f4e23310c36dad to your computer and use it in GitHub Desktop.
nathan (master *) Enigma $ nosetests
EE
======================================================================
ERROR: tests.Rotor_Test.TestRotor.test_check_letter_substitution_matches_expected_value
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/Users/nathan/Code/Enigma/tests/Rotor_Test.py", line 18, in test_check_letter_substitution_matches_expected_value
assert self.rotor.get_letter_substitution('a') == 'b'
AttributeError: TestRotor instance has no attribute 'rotor'
======================================================================
ERROR: tests.Rotor_Test.TestRotor.test_check_rotor_is_created
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/Users/nathan/Code/Enigma/tests/Rotor_Test.py", line 14, in test_check_rotor_is_created
assert self.rotor is not None
AttributeError: TestRotor instance has no attribute 'rotor'
----------------------------------------------------------------------
Ran 2 tests in 0.006s
FAILED (errors=2)
from nose.tools import *
from Enigma import Rotor
class TestRotor:
def set_up(self):
self.rotor = Rotor()
def test_check_rotor_is_created(self):
assert self.rotor is not None
def test_check_letter_substitution_matches_expected_value(self):
assert self.rotor.get_letter_substitution('a') == 'b'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment