Beispiel #1
0
 def testClassFromType(self):
     """Test Device.class_from_type()"""
     from pyVBox import Device, DVD, Floppy, \
         HardDisk, NetworkDevice, USBDevice, SharedFolder
     self.assertEqual(Device.class_from_type(Constants.DeviceType_Floppy),
                      Floppy)
     self.assertEqual(Device.class_from_type(Constants.DeviceType_DVD), DVD)
     self.assertEqual(Device.class_from_type(Constants.DeviceType_Network),
                      NetworkDevice)
     self.assertEqual(Device.class_from_type(Constants.DeviceType_USB),
                      USBDevice)
     self.assertEqual(
         Device.class_from_type(Constants.DeviceType_SharedFolder),
         SharedFolder)
Beispiel #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))
Beispiel #3
0
 def testClassFromType(self):
     """Test Device.class_from_type()"""
     from pyVBox import Device, DVD, Floppy, \
         HardDisk, NetworkDevice, USBDevice, SharedFolder
     self.assertEqual(
         Device.class_from_type(Constants.DeviceType_Floppy),
         Floppy)
     self.assertEqual(
         Device.class_from_type(Constants.DeviceType_DVD),
         DVD)
     self.assertEqual(
         Device.class_from_type(Constants.DeviceType_Network),
         NetworkDevice)
     self.assertEqual(
         Device.class_from_type(Constants.DeviceType_USB),
         USBDevice)
     self.assertEqual(
         Device.class_from_type(Constants.DeviceType_SharedFolder),
         SharedFolder)
Beispiel #4
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))
Beispiel #5
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")
Beispiel #6
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")
Beispiel #7
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")
Beispiel #8
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")
Beispiel #9
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")
Beispiel #10
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")
Beispiel #11
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")
Beispiel #12
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")
Beispiel #13
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")
Beispiel #14
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")