Esempio n. 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))
Esempio n. 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))
Esempio n. 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")
Esempio n. 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")
Esempio n. 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")
Esempio n. 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")
Esempio n. 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")
Esempio n. 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")
Esempio n. 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")
Esempio n. 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")
Esempio n. 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")
Esempio n. 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")