def test_drive_spec_and_path_splitting(self): """ Checks that splitting out the drive paths works as expected """ test_data = [( '/', ['/'], ), ( '/Applications', ['/', 'Applications'], ), ('/Users/john/something', ['/', 'Users', 'john', 'something'])] for path, expected in test_data: parts = FileSystemHelper.splitPath(path) drive = parts[0] self.assertTrue(FileSystemHelper.isDriveSpec(drive), "this isn't a drive spec: {}".format(drive)) self.assertEqual(len(parts), len(expected)) self.assertEqual(parts, expected)
def test_is_drive_spec_unicode(self): """Makes sure that both unicode and ASCII drive specs can be detected by the FileSystemHelper""" nonUnicodeDriveSpec = "/" unicodeDriveSpec = u"/" self.assertTrue(FileSystemHelper.isDriveSpec(nonUnicodeDriveSpec)) self.assertTrue(FileSystemHelper.isDriveSpec(unicodeDriveSpec))