def test_get_nrOfPorts(self): # nrOfPorts : 8 tag = "nrOfPorts" print tag value = cbrxapi.cbrx_connection_get(TestDictionary.handle, tag) print value self.assertEqual(value, 8)
def test_get_ModeChangeAuto(self): # ModeChangeAuto : True tag = "ModeChangeAuto" print tag value = cbrxapi.cbrx_connection_get(TestDictionary.handle, tag) print value self.assertEqual(value, True)
def test_get_Group(self): # Group : - tag = "Group" print tag value = cbrxapi.cbrx_connection_get(TestDictionary.handle, tag) print value self.assertEqual(value, "-")
def test_get_lcdPresent(self): # lcdPresent: true tag = "lcdPresent" print tag value = cbrxapi.cbrx_connection_get(TestDictionary.handle, tag) print value self.assertEqual(value, True)
def test_get_Profile_5_enabled(self): # Profile.5.enabled : False tag = "Profile.5.enabled" print tag value = cbrxapi.cbrx_connection_get(TestDictionary.handle, tag) print value self.assertEqual(value, False)
def test_get_Firmware(self): # Firmware: 1.55 tag = "Firmware" print tag value = cbrxapi.cbrx_connection_get(TestDictionary.handle, tag) print value self.assertEqual(value, "1.55")
def test_get_TwelveVoltRailMin_V(self): # TwelveVoltRailMin_V : 12.31 tag = "TwelveVoltRailMin_V" print tag value = cbrxapi.cbrx_connection_get(TestDictionary.handle, tag) print value self.assertEqual(value, 12.31)
def test_get_Temperature_Limit_Max_C(self): # Temperature_Limit_Max_C : 65.0 tag = "Temperature_Limit_Max_C" print tag value = cbrxapi.cbrx_connection_get(TestDictionary.handle, tag) print value self.assertEqual(value, 65.0)
def test_get_TotalCurrent_mA(self): # TotalCurrent_mA: 0 tag = "TotalCurrent_ma" print tag value = cbrxapi.cbrx_connection_get(TestDictionary.handle, tag) print value self.assertEqual(value, 0)
def test_get_Uptime_sec(self): # Uptime_sec : 151304.0 tag = "Uptime_sec" print tag value = cbrxapi.cbrx_connection_get(TestDictionary.handle, tag) print value self.assertEqual(value, 151304.0)
def test_get_Port_X_Energy_Wh(self): # Port.8.Energy_Wh: 0.0 tag = "Port.8.Energy_Wh" print tag value = cbrxapi.cbrx_connection_get(TestDictionary.handle, tag) print value self.assertEqual(value, 0.0)
def test_get_Port_X_TimeCharged_sec(self): # Port.7.TimeCharged_sec: -1 tag = "Port.7.TimeCharged_sec" print tag value = cbrxapi.cbrx_connection_get(TestDictionary.handle, tag) print value self.assertEqual(value, -1)
def test_get_Port_X_ProfileID(self): # Port.5.ProfileID: 0 tag = "Port.5.ProfileID" print tag value = cbrxapi.cbrx_connection_get(TestDictionary.handle, tag) print value self.assertEqual(value, 0)
def test_get_Port_X_Flags(self): # Port.4.Flags: R D S tag = "Port.4.Flags" print tag value = cbrxapi.cbrx_connection_get(TestDictionary.handle, tag) print value self.assertEqual(value, " R D S")
def test_get_TwelveVoltRail_flags(self): # TwelveVoltRail_flags : tag = "TwelveVoltRail_flags" print tag value = cbrxapi.cbrx_connection_get(TestDictionary.handle, tag) print value self.assertEqual(value, "")
def test_get_TwelveVoltRail_Limit_Max_V(self): # TwelveVoltRail_Limit_Max_V : 14.5 tag = "TwelveVoltRail_Limit_Max_V" print tag value = cbrxapi.cbrx_connection_get(TestDictionary.handle, tag) print value self.assertEqual(value, 14.5)
def test_get_Temperature_C(self): # Temperature_C : 37.7 tag = "Temperature_C" print tag value = cbrxapi.cbrx_connection_get(TestDictionary.handle, tag) print value self.assertEqual(value, 37.70)
def test_get_SystemTitle(self): # SystemTitle : cambrionix U8S-EXT 8 Port USB Charge+Sync tag = "SystemTitle" print tag value = cbrxapi.cbrx_connection_get(TestDictionary.handle, tag) print value self.assertEqual(value, "cambrionix U8S-EXT 8 Port USB Charge+Sync")
def test_get_Temperature_flags(self): # Temperature_flags : tag = "Temperature_flags" print tag value = cbrxapi.cbrx_connection_get(TestDictionary.handle, tag) print value self.assertEqual(value, "")
def test_get_Hardware(self): # Hardware: U8S-EXT tag = "Hardware" print tag value = cbrxapi.cbrx_connection_get(TestDictionary.handle, tag) print value self.assertEqual(value, "U8S-EXT")
def test_get_pwm_percent(self): # pwm_percent : 0.0 tag = "pwm_percent" print tag value = cbrxapi.cbrx_connection_get(TestDictionary.handle, tag) print value self.assertEqual(value, 0)
def test_get_Compiled(self): # Compiled : Jul 08 2015 10:43:20 tag = "Compiled" print tag value = cbrxapi.cbrx_connection_get(TestDictionary.handle, tag) print value self.assertEqual(value, "Jul 08 2015 10:43:20")
def test_get_Rebooted(self): # Rebooted : True tag = "Rebooted" print tag value = cbrxapi.cbrx_connection_get(TestDictionary.handle, tag) print value self.assertEqual(value, True)
def test_get_PanelID(self): # PanelID: Absent tag = "PanelID" print tag value = cbrxapi.cbrx_connection_get(TestDictionary.handle, tag) print value self.assertEqual(value, "Absent")
def test_get_FiveVoltRail_Limit_Max_V(self): # FiveVoltRail_Limit_Max_V : 5.58 tag = "FiveVoltRail_Limit_Max_V" print tag value = cbrxapi.cbrx_connection_get(TestDictionary.handle, tag) print value self.assertEqual(value, 5.58)
def test_get_Port_X_Current_mA(self): # Port.3.Current_mA tag = "Port.3.Current_mA" print tag value = cbrxapi.cbrx_connection_get(TestDictionary.handle, tag) print value self.assertEqual(value, 0)
def test0030_cbrx_connection_get(self): print "\ntest0030_cbrx_connection_get ", result = cbrxapi.cbrx_discover("local") if result: device = result[0] handle = cbrxapi.cbrx_connection_open(device) result = cbrxapi.cbrx_connection_get(handle, "nrOfPorts") self.assertNotEqual(result, 0) result = cbrxapi.cbrx_connection_close(handle)
def test0033_cbrx_connection_get_missing_tag(self): print "\ntest0032_cbrx_connection_get_missing_tag ", result = cbrxapi.cbrx_discover("local") if result: device = result[0] handle = cbrxapi.cbrx_connection_open(device) gotException = False errorCode = 0 result = "" try: result = cbrxapi.cbrx_connection_get(handle) except jsonrpc.RPCFault as e: gotException = True errorCode = e.error_code self.assertEqual(gotException, True) self.assertEqual(errorCode, JSONRPC_ERRORCODE_INVALIDPARAMETERS) self.assertEqual(result, "") result = cbrxapi.cbrx_connection_close(handle)
def test0031_cbrx_connection_get_invalid_tag(self): print "\ntest0031_cbrx_connection_get_invalid_tag ", result = cbrxapi.cbrx_discover("local") if result: device = result[0] handle = cbrxapi.cbrx_connection_open(device) gotException = False errorCode = 0 result = "" try: result = cbrxapi.cbrx_connection_get(handle, "INVALID") except jsonrpc.RPCFault as e: gotException = True errorCode = e.error_code self.assertEqual(gotException, True) self.assertEqual(errorCode, CBRXAPI_ERRORCODE_KEYNOTFOUND) self.assertEqual(result, "") result = cbrxapi.cbrx_connection_close(handle)
def test0034_cbrx_connection_get_invalid_handle(self): print "\ntest0034_cbrx_connection_get_invalid_handle ", result = cbrxapi.cbrx_discover("local") if result: device = result[0] handle = cbrxapi.cbrx_connection_open(device) badhandle = "INVALID" gotException = False errorCode = 0 result = "" try: result = cbrxapi.cbrx_connection_get(badhandle, "nrOfPorts") except jsonrpc.RPCFault as e: gotException = True errorCode = e.error_code self.assertEqual(gotException, True) self.assertEqual(errorCode, CBRXAPI_ERRORCODE_INVALIDHANDLE) self.assertEqual(result, "") result = cbrxapi.cbrx_connection_close(handle)