Esempio n. 1
0
    def testPathSearchSizeNegative(self):
        path = './testDir/'
        pf = PathFinder(path)
        f = None
        s = -1

        test = self.search('./testDir')
        files = pf.search(f,s)
        self.assertEqual(len(test), len(files), "all size > -1 files were not found")
Esempio n. 2
0
    def testPathSearchSize(self):
        path = './testDir/'
        pf = PathFinder(path)
        f = None
        s = 60000

        test = self.search('./testDir/Media')
        files = pf.search(f,s)
        self.assertEqual(len(test), len(files), "all size > 6000 files were not found")
Esempio n. 3
0
    def testPathSearchSizeOne(self):
        path = './testDir/'
        pf = PathFinder(path)
        f = None
        s = 1

        test = 9 #hardcoded if files are added for more test cases CHANGE THIS
        files = pf.search(f,s)
        self.assertEqual(test, len(files), "all size > 1 files were not found")
Esempio n. 4
0
    def testPathSearchAll(self):
        path = './testDir/'
        pf = PathFinder(path)
        f = None
        s = None

        test = self.search('./testDir/')
        files = pf.search(f,s)
        self.assertEqual(len(test), len(files), "all files were not found")
Esempio n. 5
0
    def testPathSearchPlantFile(self):
        #pathfinder attributes
        path = './testDir/'
        pf = PathFinder(path)
        f = 'plant'
        s = None

        test = self.search('./testDir/Plants')
        files = pf.search(f,s)
        self.assertEqual(len(test), len(files), "all plant files were not found")
Esempio n. 6
0
    def testPathSearchDogFile(self):
        #pathfinder attributes
        path = './testDir/'
        pf = PathFinder(path)
        f = 'dog'
        s = None

        test = self.search('./testDir/Dogs')
        files = pf.search(f,s)
        self.assertEqual(len(test), len(files), "all dog files were not found")
Esempio n. 7
0
    def testPathSearchFile(self):
        #pathfinder attributes
        path = './testDir/'
        pf = PathFinder(path)
        f = 'mp3'
        s = None

        test = self.search('./testDir/Media')
        files = pf.search(f,s)
        self.assertEqual(len(test), len(files), "all .mp3 files were not found")
Esempio n. 8
0
 def testPathConstructor(self):
     path = './'
     self.assertIsNotNone(PathFinder(path), "pathfinder failed to construct")