Example #1
0
    def load(self, url):
        filename = self.filename(url)

        debug.debug("Loading from {0}".format(filename))
        data = open(filename).read()

        debug.trace(level = 3)
        return pickle.loads(data)
Example #2
0
    def dump(self):
        original_result = cache.CacheNode.__getitem__(self, '')

        ## See if the results are lists:
        try:
            ## We convert it to sets here to ensure the comparison is
            ## order independent:
            result = set(original_result.payload) == set(self.payload)
        except TypeError:
            result = original_result.payload == self.payload

        if not result:
            print """ERROR - cached version is not reproduceable.... There must be a regression bug here!!!

Test: {0}
Previous Value: {1}
Current Value: {2}

Droping to a debugging shell....
""".format(self.stem, original_result.payload, self.payload)
            debug.trace()
            sys.exit(-1)
        else:
            print "\n\nTest Passed....\n"