def work(): with fr.SyncConnection(REDIS_IP_B, REDIS_PORT, encoding=None) as r: for key in keys: assert r.command(f'SET {key} {key}'.encode()) == b'OK' for key in keys: assert r.command(f'GET {key}'.encode()) == key.encode() for key in keys: assert r.command(f'DEL {key}'.encode()) == 1
def work(): with fr.SyncConnection(REDIS_IP, REDIS_PORT) as r: for key in keys: assert r.command(f'SET {key} {key}') == 'OK' for key in keys: assert r.command(f'GET {key}') == key for key in keys: assert r.command(f'DEL {key}') == 1
def work(): with fr.SyncConnection(REDIS_IP, REDIS_PORT) as r: assert r.command('SET testkey testvalue') == 'OK' assert r.command('GET testkey') == 'testvalue' assert r.command('DEL testkey') == 1
def work(): with fr.SyncConnection(REDIS_IP, REDIS_PORT) as r: pass
def work(): with fr.SyncConnection(REDIS_IP_B, REDIS_PORT, encoding=None) as r: assert r.command(b'SET testkey testvalue') == b'OK' assert r.command(b'GET testkey') == b'testvalue' assert r.command(b'DEL testkey') == 1