tests/wipy: Improve UART tests with no pin assignment case.

This commit is contained in:
Daniel Campora 2015-09-07 10:14:27 +02:00
parent 88ca6c94d9
commit f8b98d8329
2 changed files with 17 additions and 0 deletions

View File

@ -76,6 +76,17 @@ print(uart1.read() == b'')
print(uart1.write(b'123') == 3)
print(uart0.read() == b'123')
Pin('GP13', mode=Pin.IN)
Pin('GP12', mode=Pin.IN)
# no pin assignemnt
uart0 = UART(0, 1000000, pins=None)
print(uart0.write(b'123456789') == 9)
print(uart1.read() == b'')
print(uart1.write(b'123456789') == 9)
print(uart0.read() == b'')
print(Pin.board.GP12)
print(Pin.board.GP13)
# next ones must raise
try:
UART(0, 9600, parity=2, pins=('GP12', 'GP13', 'GP7'))

View File

@ -24,5 +24,11 @@ True
True
True
True
True
True
True
True
Pin('GP12', mode=Pin.IN, pull=Pin.PULL_NONE, drive=Pin.MED_POWER, alt=-1)
Pin('GP13', mode=Pin.IN, pull=Pin.PULL_NONE, drive=Pin.MED_POWER, alt=-1)
Exception
Exception