예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
 def test_get_Group(self):
     # Group : -
     tag = "Group"
     print tag
     value = cbrxapi.cbrx_connection_get(TestDictionary.handle, tag)
     print value
     self.assertEqual(value, "-")
예제 #4
0
 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)
예제 #5
0
 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)
예제 #6
0
 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")
예제 #7
0
 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)
예제 #8
0
 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)
예제 #9
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)
예제 #10
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)
예제 #11
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)
예제 #12
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)
예제 #13
0
 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)
예제 #14
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")
예제 #15
0
 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, "")
예제 #16
0
 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)
예제 #17
0
 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)
예제 #18
0
 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")
예제 #19
0
 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, "")
예제 #20
0
 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")
예제 #21
0
 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)
예제 #22
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")
예제 #23
0
 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)
예제 #24
0
 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")
예제 #25
0
 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)
예제 #26
0
 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)
예제 #27
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)
예제 #28
0
    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)
예제 #29
0
    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)
예제 #30
0
    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)