예제 #1
0
 def test_check_checksum(self):
     """Test that we detect when the checksum are the same. This is mainly
     to catch issues between Python 2 and 3.
     """
     fetch = main.Fetch()
     url = "file://%s/emerging.rules.tar.gz" % (os.path.dirname(
         os.path.realpath(__file__)))
     local_file = "%s/emerging.rules.tar.gz" % (os.path.dirname(
         os.path.realpath(__file__)))
     r = fetch.check_checksum(local_file, url)
     self.assertTrue(r)
예제 #2
0
    def test_check_checksum(self):
        """Test that we detect when the checksum are the same. This is mainly
        to catch issues between Python 2 and 3.
        """
        fetch = main.Fetch()
        url = "file://%s/emerging.rules.tar.gz" % (
            os.path.dirname(os.path.realpath(__file__)))
        local_file = "%s/emerging.rules.tar.gz" % (
            os.path.dirname(os.path.realpath(__file__)))

        # The URL passed to check_checksum is actually a tuple:
        #    (url, custom-header, has checksum url)
        net_arg = (url, None, True)

        r = fetch.check_checksum(local_file, net_arg)
        self.assertTrue(r)