예제 #1
0
class CorsairHidPsuTestCase(unittest.TestCase):
    def setUp(self):
        self.mock_hid = _MockPsuDevice()
        self.device = CorsairHidPsu(self.mock_hid, 'Mock Corsair HID PSU')
        self.device.connect()

    def tearDown(self):
        self.device.disconnect()

    def test_not_totally_broken(self):
        """A few reasonable example calls do not raise exceptions."""
        self.device.initialize()
        status = self.device.get_status()
        self.device.set_fixed_speed(channel='fan', duty=50)
예제 #2
0
def mock_psu():
    pid, vid, _, desc, kwargs = CorsairHidPsu.SUPPORTED_DEVICES[0]
    device = MockPsu(vendor_id=vid, product_id=pid, address='addr')
    return CorsairHidPsu(device, f'Mock {desc}', **kwargs)
예제 #3
0
 def setUp(self):
     self.mock_hid = _MockPsuDevice()
     self.device = CorsairHidPsu(self.mock_hid, 'Mock Corsair HID PSU')
     self.device.connect()
예제 #4
0
def mockPsuDevice():
    device = _MockPsuDevice(vendor_id=0x1b1c,
                            product_id=0x1c05,
                            address='addr')
    return CorsairHidPsu(device, 'mock Corsair HX750i PSU')