def testDeviceInfo181Fields(self): device_info.PROC_UPTIME = 'testdata/device_info/uptime' di = device_info.DeviceInfo181Linux26(TestDeviceId()) self.assertEqual(di.UpTime, 123) self.assertEqual(di.VendorLogFileNumberOfEntries, 0) self.assertEqual(di.VendorConfigFileNumberOfEntries, 0) self.assertEqual(di.LocationNumberOfEntries, 0)
def testDeviceId(self): did = TestDeviceId() di = device_info.DeviceInfo181Linux26(did) self.assertEqual(did.Manufacturer, di.Manufacturer) self.assertEqual(did.ManufacturerOUI, di.ManufacturerOUI) self.assertEqual(did.ModelName, di.ModelName) self.assertEqual(did.Description, di.Description) self.assertEqual(did.SerialNumber, di.SerialNumber) self.assertEqual(did.HardwareVersion, di.HardwareVersion) self.assertEqual(did.AdditionalHardwareVersion, di.AdditionalHardwareVersion) self.assertEqual(did.SoftwareVersion, di.SoftwareVersion) self.assertEqual(did.AdditionalSoftwareVersion, di.AdditionalSoftwareVersion) self.assertEqual(did.ProductClass, di.ProductClass)
def testDeviceId(self): did = TestDeviceId() di = device_info.DeviceInfo181Linux26(did) self.assertEqual(did.Manufacturer, di.Manufacturer) self.assertEqual(did.ManufacturerOUI, di.ManufacturerOUI) self.assertEqual(did.ModelName, di.ModelName) self.assertEqual(did.Description, di.Description) self.assertEqual(did.SerialNumber, di.SerialNumber) self.assertEqual(did.HardwareVersion, di.HardwareVersion) self.assertEqual(did.AdditionalHardwareVersion, di.AdditionalHardwareVersion) self.assertEqual(did.SoftwareVersion, di.SoftwareVersion) self.assertEqual(did.AdditionalSoftwareVersion, di.AdditionalSoftwareVersion) self.assertEqual(did.ProductClass, di.ProductClass) self.assertEqual(di.VendorConfigFileNumberOfEntries, 0) self.assertRaises(AttributeError, setattr, di, 'VendorConfigFileNumberOfEntries', 1)
def testValidate181(self): di = device_info.DeviceInfo181Linux26(TestDeviceId()) tr.handle.ValidateExports(di)
def testUptimeSuccess(self): device_info.PROC_UPTIME = 'testdata/device_info/uptime' di = device_info.DeviceInfo181Linux26(TestDeviceId()) self.assertEqual(di.UpTime, '123')
def testValidate181(self): di = device_info.DeviceInfo181Linux26(TestDeviceId()) di.ValidateExports()