예제 #1
0
 def testNullFactory(self):
     nullFileSystem = FileSystem()
     self.assertEquals(
         nullFileSystem.searchPrincipal("pattern", "searchMode"), list())
     self.assertTrue(
         not nullFileSystem.createFileStorer("identifier") is None)
     self.assertFalse(nullFileSystem.hasCustomMetadataSupport)
     self.assertFalse(nullFileSystem.hasMetadataSearchSupport)
     self.assertFalse(nullFileSystem.hasPrivilegeSupport)
     self.assertTrue(nullFileSystem.determineFreeDiskSpace() > 1)
     self.assertEquals(nullFileSystem.baseUri, None)
     self.assertEquals(nullFileSystem.baseConfiguration, None)
     self.assertEquals(nullFileSystem.isAccessible, False)
     nullFileSystem.updateCredentials(dict())
     nullFileSystem.updatePrincipalSearchCredentials(dict())
     nullFileSystem.release()
예제 #2
0
    def testValidInterfaceType(self):
        baseConf = SimpleMock()
        baseConf.uriScheme = _VALID_URI_SCHEME
        fileSystem = FileSystem(baseConf)

        fileStorer = fileSystem.createFileStorer("identifier")
        self.assertFalse(fileStorer is None)
        self.assertFalse(fileStorer.dataStorer is None)
        self.assertFalse(fileStorer.metadataStorer is None)
        self.assertFalse(fileStorer.privilegeStorer is None)
        self.assertTrue(fileSystem.hasCustomMetadataSupport)
        self.assertTrue(fileSystem.hasMetadataSearchSupport)
        self.assertTrue(fileSystem.hasPrivilegeSupport)
        self.assertEquals(fileSystem.determineFreeDiskSpace(), 200)
        self.assertNotEquals(fileSystem.baseUri, None)
        self.assertNotEquals(fileSystem.baseConfiguration, None)
        self.assertEquals(fileSystem.isAccessible, True)

        self.assertEquals(
            len(fileSystem.searchPrincipal("pattern", "searchMode")), 0)
        fileSystem.updateCredentials(dict())
        fileSystem.updatePrincipalSearchCredentials(dict())
        fileSystem.release()