Fixed to run on py3.7 (str.encode major issue)

This commit is contained in:
Morten Kals
2019-04-06 13:23:50 -07:00
parent 610171b3ae
commit b0519fc32f
2 changed files with 48 additions and 41 deletions

View File

@@ -14,12 +14,18 @@ should at least be maintained here.
logging.basicConfig(level=logging.DEBUG)
# Bind raw_input to input in python 2.7
try:
input = raw_input
except NameError:
pass
class TestBasics(unittest.TestCase):
def test_find(self):
""" Tests auto-connection/board detection. """
raw_input(
input(
'Plug in Arduino board w/LED at pin 13, reset, then press enter')
from Arduino import Arduino
board = None
@@ -34,11 +40,11 @@ class TestBasics(unittest.TestCase):
""" Tests connecting to an explicit port. """
port = None
while not port:
port = raw_input(
port = input(
'Plug in Arduino board w/LED at pin 13, reset.\n'\
'Enter the port where the Arduino is connected, then press enter:')
if not port:
print 'You must enter a port.'
print('You must enter a port.')
from Arduino import Arduino
board = None
try: