Ubuntu Pastebin

Paste from kyrofa at Fri, 8 Jul 2016 17:39:42 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
    def test_non_matching_checksum(self):
        zipfile = tarfile.open("checksum.zip", "w")
        zipfile.close()

        zip_source = sources.Zip("checksum.zip", "destination")

        source_checksum = '1234481102f218c981e0324180ba1234'

        with self.assertRaises(sources.ChecksumDoesNotMatch) as raised:
            zip_source.check_checksum_determine_format(
                source_checksum, "checksum.zip")
        expected_message = ("the checksum ( 1234481102f218c981e0324180ba1234 "
                            ") doesn't match the file ( 1276481102f218c981e03"
                            "24180bafd9f )")
        self.assertEqual(raised.exception.message, expected_message)
Download as text