Revision 76d9365a sdk/python/tests/test_cache.py

View differences:

sdk/python/tests/test_cache.py
34 34
        for x in range(16):
35 35
            try:
36 36
                data_in = _random(128)
37
                data_in = hashlib.md5(data_in).hexdigest() + bytes("\n") + bytes(data_in)
37
                data_in = bytes(hashlib.md5(data_in).hexdigest()) + bytes("\n") + bytes(data_in)
38 38
                c.set(url, data_in)
39 39
                data_out = c.get(url)
40 40
                digest, _, content = data_out.partition("\n")
41
                if digest != hashlib.md5(content).hexdigest():
41
                if digest != bytes(hashlib.md5(content).hexdigest()):
42 42
                    self.ok = False
43
            except Exception as err:
44
                self.ok = False
45
                print("cache failed: {}".format(err), file=sys.stderr)
43
            finally:
44
                pass
45
            #except Exception as err:
46
            #    self.ok = False
47
            #    print("cache failed: {}: {}".format(type(err), err), file=sys.stderr)
46 48

  
47 49

  
48 50
class CacheTest(unittest.TestCase):

Also available in: Unified diff