From: Cefn Hoile Date: Sun, 18 Feb 2018 01:47:26 +0000 (+0000) Subject: Now everything is embedded by default, with only testing.mcp being pure-pthon tests... X-Git-Tag: 0.1.0~4^2~119 X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/commitdiff_plain/4124402189f977489a46188f57a0ace35c279bc5 Now everything is embedded by default, with only testing.mcp being pure-pthon tests (not implementation-specific) --- diff --git a/python/testing/platform/embedded.py b/python/testing/platform/embedded.py deleted file mode 100644 index 590508b..0000000 --- a/python/testing/platform/embedded.py +++ /dev/null @@ -1,39 +0,0 @@ -""" - Tests which require an embedded platform (with actual hardware bindings) - but which are not architecture-specific. -""" -import unittest -import agnostic -import board - -if agnostic.platform == "esp8266": - LEDPIN = board.D13 -else: - raise NameError("No LED for {}".format(agnostic.platform)) - -class TestDigitalInOut(unittest.TestCase): - - - def test_default(self): - """Check that a DigitalInOut is an input with constructed""" - import digitalio - from microcontroller import Pin - pin = next(Pin.iteritems()) # grab any pin - dio = digitalio.DigitalInOut(pin) - self.assertEqual(dio.direction, digitalio.Direction.INPUT) - self.assertEqual(dio.pull, digitalio.Pull.DOWN) - - - def test_blink(self): - import digitalio - from utime import sleep - led = digitalio.DigitalInOut(LEDPIN) - led.direction = digitalio.Direction.OUTPUT - while True: - led.value = True - sleep(0.1) - led.value = False - sleep(0.1) - -def main(): - unittest.main()