Пример #1
0
 def testResourceRemovedOutside(self):
     resource, img, idevice = self.prepareTestPackage()
     resource.path.remove()
     checker = Checker(self.package)
     inconsistencies = checker.check()
     assert len(inconsistencies) == 1
     for inconsistency in inconsistencies:
         #log.info('Pre Fix package resources: %s' % self.package.resources)
         #log.info('Pre Fix idevice resources: %s' % idevice.userResources)
         inconsistency.fix()
     #log.info('Post Fix package resources: %s' % self.package.resources)
     #log.info('Post Fix idevice resources: %s' % idevice.userResources)
     assert resource.checksum not in self.package.resources
     assert resource not in idevice.userResources
Пример #2
0
 def testResourceRemovedOutside(self):
     resource, img, idevice = self.prepareTestPackage()
     resource.path.remove()
     checker = Checker(self.package)
     inconsistencies = checker.check()
     assert len(inconsistencies) == 1
     for inconsistency in inconsistencies:
         #log.info('Pre Fix package resources: %s' % self.package.resources)
         #log.info('Pre Fix idevice resources: %s' % idevice.userResources)
         inconsistency.fix()
     #log.info('Post Fix package resources: %s' % self.package.resources)
     #log.info('Post Fix idevice resources: %s' % idevice.userResources)
     assert resource.checksum not in self.package.resources
     assert resource not in idevice.userResources
Пример #3
0
 def testResourceChangedOutside(self):
     resource, img, idevice = self.prepareTestPackage()
     resource.path.write_bytes('a', append=False)
     assert resource.path.md5 not in self.package.resources
     checker = Checker(self.package, clear=False)
     inconsistencies = checker.check()
     assert len(inconsistencies) == 3
     for inconsistency in inconsistencies:
         #log.info('Pre Fix package resources: %s' % self.package.resources)
         #log.info('Pre Fix idevice resources: %s' % idevice.userResources)
         inconsistency.fix()
         #log.info('Post Fix package resources: %s' % self.package.resources)
         #log.info('Post Fix idevice resources: %s' % idevice.userResources)
     assert img.md5 not in self.package.resources
     assert resource.path.md5 in self.package.resources
     assert resource not in idevice.userResources
     assert len(self.package.resources[resource.path.md5]) == 1
     assert self.package.resources[resource.path.md5][0] in idevice.userResources
Пример #4
0
 def testResourceChangedOutside(self):
     resource, img, idevice = self.prepareTestPackage()
     resource.path.write_bytes('a', append=False)
     assert resource.path.md5 not in self.package.resources
     checker = Checker(self.package, clear=False)
     inconsistencies = checker.check()
     assert len(inconsistencies) == 3
     for inconsistency in inconsistencies:
         #log.info('Pre Fix package resources: %s' % self.package.resources)
         #log.info('Pre Fix idevice resources: %s' % idevice.userResources)
         inconsistency.fix()
         #log.info('Post Fix package resources: %s' % self.package.resources)
         #log.info('Post Fix idevice resources: %s' % idevice.userResources)
     assert img.md5 not in self.package.resources
     assert resource.path.md5 in self.package.resources
     assert resource not in idevice.userResources
     assert len(self.package.resources[resource.path.md5]) == 1
     assert self.package.resources[
         resource.path.md5][0] in idevice.userResources
Пример #5
0
 def testCheckVoidPackage(self):
     self.prepareTestPackage()
     checker = Checker(self.package)
     inconsistencies = checker.check()
     assert not inconsistencies
Пример #6
0
 def testCheckVoidPackage(self):
     self.prepareTestPackage()
     checker = Checker(self.package)
     inconsistencies = checker.check()
     assert not inconsistencies