Example #1
0
 def __init__(self, unc, disk_drive=None, persistent=False, logger=no_logging):
     """
     Creates a `UncDirectoryConnection` with a target mount point (drive letter).
     `unc` is a `UncDirectory` that describes the UNC path and necessary credentials (if
           needed).
     `disk_drive` is either `None` or a `DiskDrive`. If it is `None`, then an available disk
                  drive on the system will be automatically selected as a local mount point or a
                  `NoDrivesAvailableError` will be raised. Otherwise, the local mount point will
                  be `disk_drive. The local mount point will be set up when this
                  `UncDirectoryMount` is mounted (i.e. connected).
     `persistent` must be `True` if the UNC directory's connection should persist for all future
                  sessions of the current Windows user.
     """
     disk_drive = disk_drive if disk_drive else get_available_disk_drive()
     super(UncDirectoryMount, self).__init__(unc, disk_drive, persistent, logger)
Example #2
0
 def __init__(self,
              unc,
              disk_drive=None,
              persistent=False,
              logger=no_logging):
     """
     Creates a `UncDirectoryConnection` with a target mount point (drive letter).
     `unc` is a `UncDirectory` that describes the UNC path and necessary credentials (if
           needed).
     `disk_drive` is either `None` or a `DiskDrive`. If it is `None`, then an available disk
                  drive on the system will be automatically selected as a local mount point or a
                  `NoDrivesAvailableError` will be raised. Otherwise, the local mount point will
                  be `disk_drive. The local mount point will be set up when this
                  `UncDirectoryMount` is mounted (i.e. connected).
     `persistent` must be `True` if the UNC directory's connection should persist for all future
                  sessions of the current Windows user.
     """
     disk_drive = disk_drive if disk_drive else get_available_disk_drive()
     super(UncDirectoryMount, self).__init__(unc, disk_drive, persistent,
                                             logger)
Example #3
0
 def test_get_available_disk_drive(self):
     try:
         self.assertIsNotNone(get_available_disk_drive())
     except NoDrivesAvailableError:
         pass