Example #1
0
    def testRead(self):
        position = tryGetPos(self.globalState.safeFile)
        length = tryGetSize(self.globalState.safeFile)

        safeResult = tryRead(self.globalState.safeFile, length - position)
        testResult = tryRead(self.globalState.testFile, length - position)

        self.raiseExceptionIfDied()
        assert safeResult == testResult
Example #2
0
    def testSeek(self):
        # we assume right size of tested file - it is tested by testGetSize
        safeSize = tryGetSize(self.globalState.safeFile)
        newPos = random.randint(0, safeSize)

        safe = trySeek(self.globalState.safeFile, safeSize)
        test = trySeek(self.globalState.testFile, safeSize)

        self.raiseExceptionIfDied()
        assert safe == test
Example #3
0
 def testGetSize(self):
     safeSize = tryGetSize(self.globalState.safeFile)
     testSize = tryGetSize(self.globalState.testFile)
     self.raiseExceptionIfDied()
     assert safeSize == testSize