示例#1
0
 def testFromType(self):
     """Test Device.from_type()"""
     from pyVBox import Device, DVD, Floppy, \
         HardDisk, NetworkDevice, USBDevice, SharedFolder
     self.assertTrue(
         isinstance(Device.from_type(Constants.DeviceType_Floppy), Floppy))
     self.assertTrue(
         isinstance(Device.from_type(Constants.DeviceType_DVD), DVD))
     self.assertTrue(
         isinstance(Device.from_type(Constants.DeviceType_Network),
                    NetworkDevice))
     self.assertTrue(
         isinstance(Device.from_type(Constants.DeviceType_USB), USBDevice))
     self.assertTrue(
         isinstance(Device.from_type(Constants.DeviceType_SharedFolder),
                    SharedFolder))
示例#2
0
 def testFromType(self):
     """Test Device.from_type()"""
     from pyVBox import Device, DVD, Floppy, \
         HardDisk, NetworkDevice, USBDevice, SharedFolder
     self.assertTrue(
         isinstance(Device.from_type(Constants.DeviceType_Floppy),
                    Floppy))
     self.assertTrue(
         isinstance(Device.from_type(Constants.DeviceType_DVD),
                    DVD))
     self.assertTrue(
         isinstance(Device.from_type(Constants.DeviceType_Network),
                    NetworkDevice))
     self.assertTrue(
         isinstance(Device.from_type(Constants.DeviceType_USB),
                    USBDevice))
     self.assertTrue(
         isinstance(Device.from_type(Constants.DeviceType_SharedFolder),
                    SharedFolder))
示例#3
0
 def testNetworkDevice(self):
     """Test SharedFolder"""
     from pyVBox import Device, SharedFolder
     folder = Device.from_type(Constants.DeviceType_SharedFolder)
     self.assertTrue(isinstance(folder, SharedFolder))
     self.assertEqual(str(folder), "shared folder")
示例#4
0
 def testUSBDevice(self):
     """Test USBDevice"""
     from pyVBox import Device, USBDevice
     usb = Device.from_type(Constants.DeviceType_USB)
     self.assertTrue(isinstance(usb, USBDevice))
     self.assertEqual(str(usb), "USB device")
示例#5
0
 def testNetworkDevice(self):
     """Test NetworkDevice"""
     from pyVBox import Device, NetworkDevice
     nd = Device.from_type(Constants.DeviceType_Network)
     self.assertTrue(isinstance(nd, NetworkDevice))
     self.assertEqual(str(nd), "network device")
示例#6
0
 def testDVD(self):
     """Test DVD"""
     from pyVBox import Device, DVD
     dvd = Device.from_type(Constants.DeviceType_DVD)
     self.assertTrue(isinstance(dvd, DVD))
     self.assertEqual(str(dvd), "DVD")
示例#7
0
 def testFloppy(self):
     """Test Floppy"""
     from pyVBox import Device, Floppy
     floppy = Device.from_type(Constants.DeviceType_Floppy)
     self.assertTrue(isinstance(floppy, Floppy))
     self.assertEqual(str(floppy), "floppy")
示例#8
0
 def testNetworkDevice(self):
     """Test SharedFolder"""
     from pyVBox import Device, SharedFolder
     folder = Device.from_type(Constants.DeviceType_SharedFolder)
     self.assertTrue(isinstance(folder, SharedFolder))
     self.assertEqual(str(folder), "shared folder")
示例#9
0
 def testUSBDevice(self):
     """Test USBDevice"""
     from pyVBox import Device, USBDevice
     usb = Device.from_type(Constants.DeviceType_USB)
     self.assertTrue(isinstance(usb, USBDevice))
     self.assertEqual(str(usb), "USB device")
示例#10
0
 def testNetworkDevice(self):
     """Test NetworkDevice"""
     from pyVBox import Device, NetworkDevice
     nd = Device.from_type(Constants.DeviceType_Network)
     self.assertTrue(isinstance(nd, NetworkDevice))
     self.assertEqual(str(nd), "network device")
示例#11
0
 def testDVD(self):
     """Test DVD"""
     from pyVBox import Device, DVD
     dvd = Device.from_type(Constants.DeviceType_DVD)
     self.assertTrue(isinstance(dvd, DVD))
     self.assertEqual(str(dvd), "DVD")
示例#12
0
 def testFloppy(self):
     """Test Floppy"""
     from pyVBox import Device, Floppy
     floppy = Device.from_type(Constants.DeviceType_Floppy)
     self.assertTrue(isinstance(floppy, Floppy))
     self.assertEqual(str(floppy), "floppy")