示例#1
0
    def testLoadFilesystems(self):
        self.Tools = Tools()
        self.Tools.createRootDir()
        self.Tools.createFilesystemXML()
        self.FS = Filesystems(self.Tools.filetypesXML)

        Ext3FS = self.FS.getFilesystem(Filesystem('ext3'))
        NTFSFS = self.FS.getFilesystem(Filesystem('ntfs'))
        Filesystem3 = Filesystem('FS3')

        assert self.FS.addFilesystem(Ext3FS) == None
        assert self.FS.addFilesystem(Filesystem('ntfs')) == None
        assert self.FS.addFilesystem(Filesystem3) == Filesystem3

        assert self.FS.getFilesystem(Filesystem3) == Filesystem3
        assert self.FS.getFilesystem(NTFSFS) == NTFSFS
        assert self.FS.getFilesystem(Ext3FS) == Ext3FS

        assert self.FS.removeFilesystem(NTFSFS) == NTFSFS
        assert self.FS.removeFilesystem(NTFSFS) == None
        assert self.FS.removeFilesystem(Ext3FS) == Ext3FS
        assert self.FS.removeFilesystem(Ext3FS) == None

        self.Tools.removeTempFiles()
示例#2
0
 def testLoadFilesystems( self ) :
     self.Tools = Tools()
     self.Tools.createRootDir()
     self.Tools.createFilesystemXML()
     self.FS = Filesystems(self.Tools.filetypesXML)
     
     Ext3FS = self.FS.getFilesystem(Filesystem('ext3'))
     NTFSFS = self.FS.getFilesystem(Filesystem('ntfs'))
     Filesystem3 = Filesystem('FS3')
     
     assert self.FS.addFilesystem( Ext3FS ) == None
     assert self.FS.addFilesystem( Filesystem('ntfs') ) == None
     assert self.FS.addFilesystem( Filesystem3 ) == Filesystem3
     
     assert self.FS.getFilesystem( Filesystem3 ) == Filesystem3
     assert self.FS.getFilesystem( NTFSFS ) == NTFSFS
     assert self.FS.getFilesystem( Ext3FS ) == Ext3FS
     
     assert self.FS.removeFilesystem( NTFSFS ) == NTFSFS
     assert self.FS.removeFilesystem( NTFSFS ) == None
     assert self.FS.removeFilesystem( Ext3FS ) == Ext3FS
     assert self.FS.removeFilesystem( Ext3FS ) == None
     
     self.Tools.removeTempFiles()
示例#3
0
 def setUp(self):
     self.FS = Filesystems()  # Filesystem dir is None
示例#4
0
class testFilesystems:
    """
    Test Filesystems Class.
    """
    def setUp(self):
        self.FS = Filesystems()  # Filesystem dir is None

    def testLoadFilesystems(self):
        self.Tools = Tools()
        self.Tools.createRootDir()
        self.Tools.createFilesystemXML()
        self.FS = Filesystems(self.Tools.filetypesXML)

        Ext3FS = self.FS.getFilesystem(Filesystem('ext3'))
        NTFSFS = self.FS.getFilesystem(Filesystem('ntfs'))
        Filesystem3 = Filesystem('FS3')

        assert self.FS.addFilesystem(Ext3FS) == None
        assert self.FS.addFilesystem(Filesystem('ntfs')) == None
        assert self.FS.addFilesystem(Filesystem3) == Filesystem3

        assert self.FS.getFilesystem(Filesystem3) == Filesystem3
        assert self.FS.getFilesystem(NTFSFS) == NTFSFS
        assert self.FS.getFilesystem(Ext3FS) == Ext3FS

        assert self.FS.removeFilesystem(NTFSFS) == NTFSFS
        assert self.FS.removeFilesystem(NTFSFS) == None
        assert self.FS.removeFilesystem(Ext3FS) == Ext3FS
        assert self.FS.removeFilesystem(Ext3FS) == None

        self.Tools.removeTempFiles()

    def testAddFilesystem(self):
        Filesystem1 = Filesystem('FS1')
        Filesystem2 = Filesystem('FS2')
        Filesystem3 = Filesystem('FS3')
        assert self.FS.addFilesystem(Filesystem1) == Filesystem1
        assert self.FS.addFilesystem(Filesystem1) == None
        assert self.FS.addFilesystem(Filesystem2) == Filesystem2
        assert self.FS.addFilesystem(Filesystem('FS2')) == None
        assert self.FS.addFilesystem(Filesystem3) == Filesystem3

    def testGetFilesystem(self):
        Filesystem1 = Filesystem('FS1')
        Filesystem2 = Filesystem('FS2')
        Filesystem3 = Filesystem('FS3')
        self.FS.addFilesystem(Filesystem1)
        self.FS.addFilesystem(Filesystem2)
        assert self.FS.getFilesystem(Filesystem1) == Filesystem1
        assert self.FS.getFilesystem(Filesystem3) == None
        assert self.FS.getFilesystem(Filesystem('FS2')) == Filesystem2
        assert self.FS.getFilesystem(Filesystem('FS3')) == None

    def testRemoveFilesystem(self):
        Filesystem1 = Filesystem('FS1')
        Filesystem2 = Filesystem('FS2')
        Filesystem3 = Filesystem('FS3')
        self.FS.addFilesystem(Filesystem1)
        self.FS.addFilesystem(Filesystem2)
        assert self.FS.removeFilesystem(Filesystem1) == Filesystem1
        assert self.FS.removeFilesystem(Filesystem1) == None
        assert self.FS.removeFilesystem(Filesystem('FS3')) == None
        assert self.FS.removeFilesystem(Filesystem('FS2')) == Filesystem2
示例#5
0
 def setUp(self) :
     self.FS = Filesystems() # Filesystem dir is None
示例#6
0
class testFilesystems :
    """
    Test Filesystems Class.
    """
    def setUp(self) :
        self.FS = Filesystems() # Filesystem dir is None
    
    def testLoadFilesystems( self ) :
        self.Tools = Tools()
        self.Tools.createRootDir()
        self.Tools.createFilesystemXML()
        self.FS = Filesystems(self.Tools.filetypesXML)
        
        Ext3FS = self.FS.getFilesystem(Filesystem('ext3'))
        NTFSFS = self.FS.getFilesystem(Filesystem('ntfs'))
        Filesystem3 = Filesystem('FS3')
        
        assert self.FS.addFilesystem( Ext3FS ) == None
        assert self.FS.addFilesystem( Filesystem('ntfs') ) == None
        assert self.FS.addFilesystem( Filesystem3 ) == Filesystem3
        
        assert self.FS.getFilesystem( Filesystem3 ) == Filesystem3
        assert self.FS.getFilesystem( NTFSFS ) == NTFSFS
        assert self.FS.getFilesystem( Ext3FS ) == Ext3FS
        
        assert self.FS.removeFilesystem( NTFSFS ) == NTFSFS
        assert self.FS.removeFilesystem( NTFSFS ) == None
        assert self.FS.removeFilesystem( Ext3FS ) == Ext3FS
        assert self.FS.removeFilesystem( Ext3FS ) == None
        
        self.Tools.removeTempFiles()
        
    def testAddFilesystem( self ) :
        Filesystem1 = Filesystem('FS1')
        Filesystem2 = Filesystem('FS2')
        Filesystem3 = Filesystem('FS3')
        assert self.FS.addFilesystem( Filesystem1 ) == Filesystem1
        assert self.FS.addFilesystem( Filesystem1 ) == None
        assert self.FS.addFilesystem( Filesystem2 ) == Filesystem2
        assert self.FS.addFilesystem( Filesystem('FS2') ) == None
        assert self.FS.addFilesystem( Filesystem3 ) == Filesystem3
        
    def testGetFilesystem(self) :
        Filesystem1 = Filesystem('FS1')
        Filesystem2 = Filesystem('FS2')
        Filesystem3 = Filesystem('FS3')
        self.FS.addFilesystem( Filesystem1 )
        self.FS.addFilesystem( Filesystem2 )
        assert self.FS.getFilesystem( Filesystem1 ) == Filesystem1
        assert self.FS.getFilesystem( Filesystem3 ) == None
        assert self.FS.getFilesystem( Filesystem('FS2') ) == Filesystem2
        assert self.FS.getFilesystem( Filesystem('FS3') ) == None
        
    def testRemoveFilesystem(self) :
        Filesystem1 = Filesystem('FS1')
        Filesystem2 = Filesystem('FS2')
        Filesystem3 = Filesystem('FS3')
        self.FS.addFilesystem( Filesystem1 )
        self.FS.addFilesystem( Filesystem2 )
        assert self.FS.removeFilesystem( Filesystem1 ) == Filesystem1
        assert self.FS.removeFilesystem( Filesystem1 ) == None
        assert self.FS.removeFilesystem( Filesystem('FS3') ) == None
        assert self.FS.removeFilesystem( Filesystem('FS2') ) == Filesystem2