Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(8)  |  Call(6)  |  Derive(0)  |  Import(2)

src/b/r/BrickPython-0.4/test/TestMotor.py   BrickPython(Download)
 
 
from BrickPython.BrickPiWrapper import BrickPiWrapper
from BrickPython.Scheduler import Scheduler, StopCoroutineException
import unittest
    def setUp(self):
        self.bp = BrickPiWrapper()
        motor = self.motor = self.bp.motor( 'A' )
        #motor.position = Mock()
        motor.timeMillis = Mock()

src/b/r/BrickPython-0.4/test/TestBrickPiWrapper.py   BrickPython(Download)
 
 
from BrickPython.BrickPiWrapper import BrickPiWrapper
from BrickPython.BrickPi import BrickPi, PORT_1, TYPE_SENSOR_ULTRASONIC_CONT,\
    TYPE_SENSOR_RAW
    def testClassExists(self):
        assert(BrickPiWrapper() != None)
 
    def testAllMethodsOK(self):
        bp = BrickPiWrapper({'1': Sensor})
    def testSensorSetup(self):
        bp = BrickPiWrapper( {PORT_1: TYPE_SENSOR_ULTRASONIC_CONT} )
        assert( BrickPi.SensorType[PORT_1] == TYPE_SENSOR_ULTRASONIC_CONT)
 
    def testSensorSetupBetterScopingSyntax(self):
        bp = BrickPiWrapper( {'1': Sensor.ULTRASONIC_CONT} )