def test_checkSizeAndCheckSum_validates_size(self):
     (path, md5, sha1, size) = self.writeUploadFile('foo', 'bar')
     nuf = NascentUploadFile(path, dict(MD5=md5), size - 1, 'main/devel',
                             None, None, None)
     self.assertRaisesWithContent(
         UploadError,
         'File foo mentioned in the changes has a size mismatch. 3 != 2',
         nuf.checkSizeAndCheckSum)
 def test_checkSizeAndCheckSum_validates_sha1(self):
     (path, md5, sha1, size) = self.writeUploadFile('foo', 'bar')
     nuf = NascentUploadFile(path, dict(MD5=md5, SHA1='foobar'), size,
                             'main/devel', None, None, None)
     self.assertRaisesWithContent(
         UploadError,
         'File foo mentioned in the changes has a SHA1 mismatch. '
         '62cdb7020ff920e5aa642c3d4066950dd1f01f4d != foobar',
         nuf.checkSizeAndCheckSum)
 def test_checkSizeAndCheckSum_validates_md5(self):
     (path, md5, sha1, size) = self.writeUploadFile('foo', 'bar')
     nuf = NascentUploadFile(path, dict(MD5='deadbeef'), size, 'main/devel',
                             None, None, None)
     self.assertRaisesWithContent(
         UploadError,
         'File foo mentioned in the changes has a MD5 mismatch. '
         '37b51d194a7513e45b56f6524f2d51f2 != deadbeef',
         nuf.checkSizeAndCheckSum)
Example #4
0
 def __init__(self, filepath, checksums, size, policy, logger):
     component_and_section = priority = "--no-value--"
     NascentUploadFile.__init__(self, filepath, checksums, size,
                                component_and_section, priority, policy,
                                logger)
Example #5
0
 def __init__(self, filepath, checksums, size, policy, logger):
     component_and_section = priority = "--no-value--"
     NascentUploadFile.__init__(
         self, filepath, checksums, size, component_and_section,
         priority, policy, logger)