コード例 #1
0
    def test_phidget_by_serial(self):
        # Get the serial number of the phidget from the usb descriptor
        serial = self.find_serial()

        # connect to that phidget precisely
        phd = Relay(serial)
        self.assertTrue(phd.zero_on())
コード例 #2
0
    def test_phidget_by_serial(self):
        # Get the serial number of the phidget from the usb descriptor
        serial = self.find_serial()

        # connect to that phidget precisely
        phd = Relay(serial)
        self.assertTrue(phd.zero_on())
コード例 #3
0
    def test_three_on_off_toggle(self):
        phd_relay = Relay()
        result = phd_relay.three_off()
        self.assertTrue(result, "Successfully turned off")

        result = phd_relay.three_on()
        self.assertTrue(result, "Successfully turned off")

        result = phd_relay.three_toggle()
        self.assertTrue(result, "Successfully toggled")
コード例 #4
0
    def test_three_on_off_toggle(self):
        phd_relay = Relay()
        result = phd_relay.three_off()
        self.assertTrue(result, "Successfully turned off")

        result = phd_relay.three_on()
        self.assertTrue(result, "Successfully turned off")

        result = phd_relay.three_toggle()
        self.assertTrue(result, "Successfully toggled")
コード例 #5
0
    def test_open_phidget(self):
        """ Apparently, LogCapture is setup to compare the entire log
         entries at once. So go through all of the operations, then
         check the total log output at the end.
        """
        phd = Relay()
        self.assertTrue(phd.zero_on())

        gr = self.log_group
        self.log_capture.check(
            (gr, "DEBUG", "Start of phidgeter with serial: None"),
            (gr, "DEBUG", "Attempting to open phidget"),
            (gr, "DEBUG", "Attempt to open first found"),
            (gr, "DEBUG", "Wait for attach 10300ms"),
            (gr, "INFO", "Opened phidget"),
            (gr, "DEBUG", "Attempting to close phidget"),
            (gr, "INFO", "Closed phidget")
            )
コード例 #6
0
    def test_open_phidget(self):
        """ Apparently, LogCapture is setup to compare the entire log
         entries at once. So go through all of the operations, then
         check the total log output at the end.
        """
        phd = Relay()
        self.assertTrue(phd.zero_on())

        gr = self.log_group
        self.log_capture.check(
            (gr, "DEBUG", "Start of phidgeter with serial: None"),
            (gr, "DEBUG", "Attempting to open phidget"),
            (gr, "DEBUG", "Attempt to open first found"),
            (gr, "DEBUG", "Wait for attach 10300ms"),
            (gr, "INFO", "Opened phidget"),
            (gr, "DEBUG", "Attempting to close phidget"),
            (gr, "INFO", "Closed phidget")
            )