Ejemplo n.º 1
0
    def testNoQualifier(self):
        """Tests NoSize Calculations based on Input.

        Should convert No Qualifiers to MB
        """
        liten = Liten(spath='testData', fileSize=self.NoQualifier)
        self.assertEqual(liten.convertSize(liten.fileSize), 1048576)
Ejemplo n.º 2
0
    def testNoQualifier(self):
        """Tests NoSize Calculations based on Input.

        Should convert No Qualifiers to MB
        """
        liten = Liten(spath="testData", fileSize=self.NoQualifier)
        self.assertEqual(liten.convertSize(liten.fileSize), 1048576)
Ejemplo n.º 3
0
    def testNoQualifier(self):
        """Tests NoSize Calculations based on Input.

        Should convert No Qualifiers to MB
        """
        liten = Liten(spath='testData', fileSize=self.NoQualifier)
        NoSizeType = liten.sizeType()
Ejemplo n.º 4
0
    def testBogus(self):
        """Tests Bogus Size Input.

        Should raise exception UnboundLocalError or fail
        """
        try:
            liten = Liten(spath='testData', fileSize=self.Bogus)
            BogusType = liten.sizeType()
        except UnboundLocalError:
            pass
Ejemplo n.º 5
0
    def testBogus(self):
        """Tests Bogus Size Input.

        Should raise exception ValueError or fail
        """
        liten = Liten(spath='testData', fileSize=self.Bogus)
        self.assertRaises(ValueError, liten.convertSize, liten.fileSize)
Ejemplo n.º 6
0
 def testDupeFileDetection(self):
     """Test checksum of duplicate files"""
     liten = Liten(spath='testData')
     checksumOne = liten.createChecksum(self.dupeFileOne)
     checksumTwo = liten.createChecksum(self.dupeFileTwo)
     self.assertEqual(checksumOne, checksumTwo)
Ejemplo n.º 7
0
 def testDupeFileDetectionError(self):
     """Test checksum of Non-duplicate files"""
     liten = Liten(spath='testData')
     checksumOne = liten.createChecksum(self.dupeFileOne)
     checksumThree = liten.createChecksum(self.nonDupeFile)
     self.assertNotEqual(checksumOne, checksumThree)
Ejemplo n.º 8
0
 def testDupeFileDetection(self):
     """Test checksum of duplicate files"""
     liten = Liten(spath='testData')
     checksumOne = liten.createChecksum(self.dupeFileOne)
     checksumTwo = liten.createChecksum(self.dupeFileTwo)
     self.assertEqual(checksumOne, checksumTwo)
Ejemplo n.º 9
0
 def badChecksumDetection(self):
     """Bad Checksum Detection Should Raise Exception."""
     liten = Liten(spath='testData')
     badChecksumAttempt = liten.createChecksum('fileNotFound.txt')
Ejemplo n.º 10
0
 def testGBconvertSize(self):
     """Tests GBSize Calculations based on Input."""
     self.assertEqual(Liten().convertSize(self.GBFileSize), 1073741824)
Ejemplo n.º 11
0
 def testModDate(self):
     """Test modDate method."""
     liten = Liten(spath='testData')
     modDate = liten.makeModDate(self.fakePath)
Ejemplo n.º 12
0
 def testGBSizeType(self):
     """Tests GBSize Calculations based on Input."""
     liten = Liten(spath='testData', fileSize=self.GBFileSize)
     GBSizeType = liten.sizeType()
     self.assertEqual(GBSizeType, 1073741824)
Ejemplo n.º 13
0
 def testKByteconvertSize(self):
     """Tests KBSize Calculations based on Input."""
     self.assertEqual(Liten().convertSize(self.KBFileSize), 1024)
Ejemplo n.º 14
0
 def testKByteSizeType(self):
     """Tests KBSize Calculations based on Input."""
     liten = Liten(spath='testData', fileSize=self.KBFileSize)
     KBSizeType = liten.sizeType()
     self.assertEqual(KBSizeType, 1024)
Ejemplo n.º 15
0
 def testMBByteSizeType(self):
     """Tests MBSize Calculations based on Input."""
     liten = Liten(spath='testData', fileSize=self.MBFileSize)
     MBSizeType = liten.sizeType()
     self.assertEqual(MBSizeType, 1048576)
Ejemplo n.º 16
0
 def testByteSizeType(self):
     """Tests ByteSize Calculations based on Input."""
     liten = Liten(spath='testData', fileSize=self.byteFileSize)
     byteSizeType = liten.sizeType()
     self.assertEqual(byteSizeType, 1)
Ejemplo n.º 17
0
 def testCreateExt(self):
     """Test Create Extension Method."""
     liten = Liten(spath='testData')
     createExt = liten.createExt(self.dupeFileOne)
     self.assertEqual(createExt, ".txt")
Ejemplo n.º 18
0
 def testDupeFileDetectionError(self):
     """Test checksum of Non-duplicate files"""
     liten = Liten(spath='testData')
     checksumOne = liten.createChecksum(self.dupeFileOne)
     checksumThree= liten.createChecksum(self.nonDupeFile)
     self.assertNotEqual(checksumOne, checksumThree)
Ejemplo n.º 19
0
 def testCreateExt(self):
     """Test Create Extension Method."""
     liten = Liten(spath='testData')
     createExt = liten.createExt(self.dupeFileOne)
     self.assertEqual(createExt, ".txt")
Ejemplo n.º 20
0
 def testTBSizeType(self):
     """Tests TBSize Calculations based on Input."""
     liten = Liten(spath='testData', fileSize=self.TBFileSize)
     TBSizeType = liten.sizeType()
     self.assertEqual(TBSizeType, 1099511627776)
Ejemplo n.º 21
0
 def testByteconvertSize(self):
     """Tests ByteSize Calculations based on Input."""
     liten = Liten(spath='testData', fileSize=self.byteFileSize)
     byteconvertSize = liten.convertSize(liten.fileSize)
     self.assertEqual(byteconvertSize, 1)
Ejemplo n.º 22
0
 def testCreateDate(self):
     """Test createDate method."""
     liten = Liten(spath='testData')
     createDate = liten.makeCreateDate(self.fakePath)
Ejemplo n.º 23
0
 def testMBByteconvertSize(self):
     """Tests MBSize Calculations based on Input."""
     self.assertEqual(Liten().convertSize(self.MBFileSize), 1048576)
Ejemplo n.º 24
0
 def testModDate(self):
     """Test modDate method."""
     liten = Liten(spath='testData')
     modDate = liten.makeModDate(self.fakePath)
Ejemplo n.º 25
0
 def testTBconvertSize(self):
     """Tests TBSize Calculations based on Input."""
     self.assertEqual(Liten().convertSize(self.TBFileSize), 1099511627776)
Ejemplo n.º 26
0
 def testCreateDate(self):
     """Test createDate method."""
     liten = Liten(spath='testData')
     createDate = liten.makeCreateDate(self.fakePath)
Ejemplo n.º 27
0
 def testByteconvertSize(self):
     """Tests ByteSize Calculations based on Input."""
     liten = Liten(spath="testData", fileSize=self.byteFileSize)
     byteconvertSize = liten.convertSize(liten.fileSize)
     self.assertEqual(byteconvertSize, 1)
Ejemplo n.º 28
0
 def badChecksumDetection(self):
     """Bad Checksum Detection Should Raise Exception."""
     liten = Liten(spath='testData')
     badChecksumAttempt = liten.createChecksum('fileNotFound.txt')