mirror of
https://github.com/thearn/Python-Arduino-Command-API.git
synced 2026-01-13 16:38:03 -05:00
27 lines
732 B
Python
27 lines
732 B
Python
import unittest
|
|
import time
|
|
from Arduino import Arduino
|
|
|
|
"""
|
|
A collection of some basic tests for the Arduino library.
|
|
|
|
Extensive coverage is a bit difficult, since a positive test involves actually
|
|
connecting and issuing commands to a live Arduino, hosting any hardware
|
|
required to test a particular function. But a core of basic communication tests
|
|
should at least be maintained here.
|
|
"""
|
|
|
|
|
|
class TestBasics(unittest.TestCase):
|
|
_ = raw_input('Plug in Arduino board w/LED at pin 13, reset, then press enter')
|
|
board = Arduino('9600')
|
|
|
|
def test_find(self):
|
|
"""
|
|
Tests auto-connection/board detection
|
|
"""
|
|
self.assertIsNotNone(self.board.port)
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|