Ejemplo n.º 1
0
import unittest

import pingo
from pingo.test import level0
from pingo.test import level1
from pingo.detect import check_board

running_on_galileo = check_board(pingo.intel.Galileo2)


class GalileoTest(unittest.TestCase):
    def setUp(self):
        self.board = pingo.intel.Galileo2()
        # Level0 Parameters
        self.digital_output_pin_number = 6
        self.digital_input_pin_number = 3
        self.total_pins = 20

        # Level1 Parameters
        self.analog_input_pin_number = 'A3'
        self.expected_analog_input = 4096
        self.expected_analog_ratio = 0.98

    def tearDown(self):
        pass
        # self.board.cleanup()


@unittest.skipIf(not running_on_galileo, 'Galileo not detected')
class GalileoBasics(GalileoTest, level0.BoardBasics):
    def test_list_pins(self):
Ejemplo n.º 2
0
import platform
import unittest

import pingo
from pingo.test import level0
from pingo.test import level1
from pingo.detect import has_module, check_board

running_on_arduino = check_board(pingo.arduino.ArduinoFirmata)


class ArduinoFirmataTest(unittest.TestCase):

    def setUp(self):
        device = pingo.detect.detect._find_arduino_dev(platform.system())
        self.board = pingo.arduino.ArduinoFirmata(device)

        # Level0 Parameters
        # self.vdd_pin_number = 0
        self.digital_output_pin_number = 13
        self.digital_input_pin_number = 2
        self.total_pins = 14

        # Level1 Parameters
        self.analog_input_pin_number = 'A4'
        self.expected_analog_input = 1004
        self.expected_analog_ratio = 0.98

    def tearDown(self):
        self.board.cleanup()
Ejemplo n.º 3
0
import unittest

import pingo
from pingo.test import level0
from pingo.test import level1
from pingo.detect import check_board

running_on_galileo = check_board(pingo.intel.Edison)


class EdisonTest(unittest.TestCase):

    def setUp(self):
        self.board = pingo.intel.Edison()
        # Level0 Parameters
        self.digital_output_pin_number = 6
        self.digital_input_pin_number = 3
        self.total_pins = 20

        # Level1 Parameters
        self.analog_input_pin_number = 'A3'
        self.expected_analog_input = 4096
        self.expected_analog_ratio = 0.98

    def tearDown(self):
        pass
        # self.board.cleanup()


@unittest.skipIf(not running_on_galileo, 'Edison not detected')
class EdisonBasics(EdisonTest, level0.BoardBasics):
Ejemplo n.º 4
0
import unittest

import pingo
from pingo.test import level0
from pingo.test import level1
from pingo.detect import check_board

running_on_pcduino = check_board(pingo.pcduino.PcDuino)


class PcDuinoTest(unittest.TestCase):

    def setUp(self):
        self.board = pingo.pcduino.PcDuino()
        # Level0 Parameters
        self.digital_output_pin_number = 3
        self.digital_input_pin_number = 0
        self.total_pins = 20

        # Level1 Parameters
        self.analog_input_pin_number = 'A3'
        self.expected_analog_input = 4096
        self.expected_analog_ratio = 0.98

    def tearDown(self):
        self.board.cleanup()


@unittest.skipIf(not running_on_pcduino, 'PcDuino not detected')
class PcDuinoBasics(PcDuinoTest, level0.BoardBasics):
    def test_list_pins(self):
Ejemplo n.º 5
0
import unittest

import pingo
from pingo.test import level0
from pingo.test import level1
from pingo.detect import check_board

running_on_galileo = check_board(pingo.galileo.Galileo2)


class GalileoTest(unittest.TestCase):
    def setUp(self):
        self.board = pingo.galileo.Galileo2()
        # Level0 Parameters
        self.digital_output_pin_number = 6
        self.digital_input_pin_number = 3
        self.total_pins = 20

        # Level1 Parameters
        self.analog_input_pin_number = 'A3'
        self.expected_analog_input = 4096
        self.expected_analog_ratio = 0.98

    def tearDown(self):
        pass
        # self.board.cleanup()


@unittest.skipIf(not running_on_galileo, 'Galileo not detected')
class GalileoBasics(GalileoTest, level0.BoardBasics):
    def test_list_pins(self):
Ejemplo n.º 6
0
import unittest

import pingo
from pingo.test import level0
from pingo.detect import has_module, check_board

running_on_pymcu = check_board(pingo.pymcuboard.Pymcuboard)


class PymcuTest(unittest.TestCase):

    def setUp(self):
        self.board = pingo.pymcuboard.Pymcuboard()

        self.vdd_pin_number = 0
        self.digital_output_pin_number = 13
        self.digital_input_pin_number = 8
        self.total_pins = 26

    def tearDown(self):
        self.board.cleanup()


@unittest.skipIf(not running_on_pymcu, "pyMcu not detected")
@unittest.skipIf(
    not has_module('pymcu'), "pingo.pymcuboard requires pymcu installed")
class PymcuBasics(PymcuTest, level0.BoardBasics):
    pass


@unittest.skipIf(not running_on_pymcu, "pyMcu not detected")
Ejemplo n.º 7
0
import unittest

import pingo
from pingo.test import level0
from pingo.test import level1
from pingo.detect import check_board

running_on_galileo = check_board(pingo.intel.Galileo2)


class GalileoTest(unittest.TestCase):

    def setUp(self):
        self.board = pingo.intel.Galileo2()
        # Level0 Parameters
        self.digital_output_pin_number = 6
        self.digital_input_pin_number = 3
        self.total_pins = 20

        # Level1 Parameters
        self.analog_input_pin_number = 'A3'
        self.expected_analog_input = 4096
        self.expected_analog_ratio = 0.98

    def tearDown(self):
        pass
        # self.board.cleanup()


@unittest.skipIf(not running_on_galileo, 'Galileo not detected')
class GalileoBasics(GalileoTest, level0.BoardBasics):
Ejemplo n.º 8
0
import platform
import unittest

import pingo
from pingo.test import level0
from pingo.test import level1
from pingo.detect import has_module, check_board

running_on_arduino = check_board(pingo.arduino.ArduinoFirmata)


class ArduinoFirmataTest(unittest.TestCase):
    def setUp(self):
        device = pingo.detect.detect._find_arduino_dev(platform.system())
        self.board = pingo.arduino.ArduinoFirmata(device)

        # Level0 Parameters
        # self.vdd_pin_number = 0
        self.digital_output_pin_number = 13
        self.digital_input_pin_number = 2
        self.total_pins = 14

        # Level1 Parameters
        self.analog_input_pin_number = 'A4'
        self.expected_analog_input = 1004
        self.expected_analog_ratio = 0.98

    def tearDown(self):
        self.board.cleanup()

Ejemplo n.º 9
0
import unittest

import pingo
from pingo.test import level0
from pingo.detect import has_module, check_board

running_on_raspberry = check_board(pingo.rpi.RaspberryPi)


class RaspberryTest(unittest.TestCase):

    def setUp(self):
        self.board = pingo.rpi.RaspberryPi()
        self.vdd_pin_number = 2
        self.digital_output_pin_number = 13
        self.digital_input_pin_number = 7
        self.total_pins = 26

    def tearDown(self):
        self.board.cleanup()


@unittest.skipIf(not running_on_raspberry, "RaspberryPi not detected")
@unittest.skipIf(
    not has_module('RPi'), "pingo.rpi requires RPi.GPIO installed")
class RaspberryBasics(RaspberryTest, level0.BoardBasics):
    pass


@unittest.skipIf(not running_on_raspberry, "RaspberryPi not detected")
@unittest.skipIf(
Ejemplo n.º 10
0
import unittest

import pingo
from pingo.test import level0
from pingo.detect import check_board

running_on_beaglebone = check_board(pingo.bbb.BeagleBoneBlack)


class BeagleBoneBlackTest(unittest.TestCase):

    def setUp(self):
        self.board = pingo.bbb.BeagleBoneBlack()
        self.vdd_pin_number = 0
        self.digital_output_pin_number = 0
        self.digital_input_pin_number = 0
        self.total_pins = 0

    def tearDown(self):
        self.board.cleanup()


@unittest.skipIf(
    not running_on_beaglebone, "BeagleBoneBlack not detected")
class BeagleBoneBlackBasics(BeagleBoneBlackTest, level0.BoardBasics):
    pass


@unittest.skipIf(
    not running_on_beaglebone, "BeagleBoneBlack not detected")
class BeagleBoneBlackExceptions(BeagleBoneBlackTest, level0.BoardExceptions):
Ejemplo n.º 11
0
import os
import sys
import time
import unittest

import pingo
from pingo.test import level0
from pingo.detect import check_board

running_on_beaglebone = check_board(pingo.bbb.BeagleBoneBlack)


class BeagleBoneBlackTest(unittest.TestCase):

    def setUp(self):
        self.board = pingo.bbb.BeagleBoneBlack()
        self.vdd_pin_number = 0
        self.digital_output_pin_number = 0
        self.digital_input_pin_number = 0
        self.total_pins = 0

    def tearDown(self):
        self.board.cleanup()


@unittest.skipIf(not running_on_beaglebone,
    "BeagleBoneBlack not detected")
class BeagleBoneBlackBasics(BeagleBoneBlackTest, level0.BoardBasics):
    pass

Ejemplo n.º 12
0
import os
import sys
import time
import unittest

import pingo
from pingo.test import level0
from pingo.test import level1
from pingo.detect import check_board

running_on_pcduino = check_board(pingo.pcduino.PcDuino)


class PcDuinoTest(unittest.TestCase):
    def setUp(self):
        self.board = pingo.pcduino.PcDuino()
        # Level0 Parameters
        self.digital_output_pin_number = 3
        self.digital_input_pin_number = 11
        self.total_pins = 20

        # Level1 Parameters
        self.analog_input_pin_number = 'A2'
        self.expected_analog_input = 4014
        self.expected_analog_ratio = 0.98

    def tearDown(self):
        self.board.cleanup()


@unittest.skipIf(not running_on_pcduino, 'PcDuino not detected')
Ejemplo n.º 13
0
import os
import sys
import time
import unittest

import pingo
from pingo.test import level0
from pingo.detect import check_board

running_on_udoo = check_board(pingo.udoo.Udoo)


class UdooTest(unittest.TestCase):
    def setUp(self):
        self.board = pingo.udoo.Udoo()
        self.vdd_pin_number = 0
        self.digital_output_pin_number = 0
        self.digital_input_pin_number = 0
        self.total_pins = 0

    def tearDown(self):
        self.board.cleanup()


@unittest.skipIf(not running_on_udoo, 'Udoo not detected')
class UdooBasics(UdooTest, level0.BoardBasics):
    pass


@unittest.skipIf(not running_on_udoo, 'Udoo not detected')
class UdooExceptions(UdooTest, level0.BoardExceptions):
Ejemplo n.º 14
0
import unittest

import pingo
from pingo.test import level0
from pingo.detect import check_board

running_on_udoo = check_board(pingo.udoo.Udoo)


class UdooTest(unittest.TestCase):

    def setUp(self):
        self.board = pingo.udoo.Udoo()
        self.vdd_pin_number = 0
        self.digital_output_pin_number = 0
        self.digital_input_pin_number = 0
        self.total_pins = 0

    def tearDown(self):
        self.board.cleanup()


@unittest.skipIf(not running_on_udoo, 'Udoo not detected')
class UdooBasics(UdooTest, level0.BoardBasics):
    pass


@unittest.skipIf(not running_on_udoo, 'Udoo not detected')
class UdooExceptions(UdooTest, level0.BoardExceptions):
    pass
Ejemplo n.º 15
0
import unittest

import pingo
from pingo.test import level0
from pingo.test import level1
from pingo.detect import check_board

running_on_galileo = check_board(pingo.galileo.Galileo2)


class GalileoTest(unittest.TestCase):
    def setUp(self):
        self.board = pingo.galileo.Galileo2()
        # Level0 Parameters
        self.digital_output_pin_number = 6
        self.digital_input_pin_number = 3
        self.total_pins = 20

        # Level1 Parameters
        self.analog_input_pin_number = "A3"
        self.expected_analog_input = 4096
        self.expected_analog_ratio = 0.98

    def tearDown(self):
        pass
        # self.board.cleanup()


@unittest.skipIf(not running_on_galileo, "Galileo not detected")
class GalileoBasics(GalileoTest, level0.BoardBasics):
    def test_list_pins(self):
Ejemplo n.º 16
0
import unittest

import pingo
from pingo.test import level0
from pingo.test import level1
from pingo.detect import check_board

running_on_galileo = check_board(pingo.intel.Edison)


class EdisonTest(unittest.TestCase):
    def setUp(self):
        self.board = pingo.intel.Edison()
        # Level0 Parameters
        self.digital_output_pin_number = 6
        self.digital_input_pin_number = 3
        self.total_pins = 20

        # Level1 Parameters
        self.analog_input_pin_number = 'A3'
        self.expected_analog_input = 4096
        self.expected_analog_ratio = 0.98

    def tearDown(self):
        pass
        # self.board.cleanup()


@unittest.skipIf(not running_on_galileo, 'Edison not detected')
class EdisonBasics(EdisonTest, level0.BoardBasics):
    def test_list_pins(self):