def check_set(exists, set_name): """ Verifies that the given set does or doesn't exist. """ if exists: assert lib.test_record(set_name, KEY), "Record %s:%s does not exist" % (set_name, KEY) return [lib.read_record(set_name, KEY)] else: assert not lib.test_record(set_name, KEY), "Unexpected record %s:%s" % (set_name, KEY) return []
def check_expired(key): """ Ensures that the given key does not exist. """ assert not lib.test_record(lib.SET, key), "Key %s should not exist" % key
def checker(): """ Verifies that the expected records are there. """ for index in xrange(10000): assert lib.test_record(lib.SET, index), "Key %s is missing" % index