def test_ttl(): req_str = 'time live 4' db_cla.ttl_req(req_str) result1 = db_cla.get_req('time') assert result1 == 'live' time.sleep(4) result2 = db_cla.get_req('time') assert result2 == 'None'
def test_get(): req_str = 'hello world' db_cla.set_req(req_str) result = db_cla.get_req('name') assert result == 'hello'
def test_del(): db_cla.set_req(['python', 'code']) result1 = db_cla.del_req(['python']) result2 = db_cla.get_req(['python']) assert result1 == 'OK' and result2 == 'None'
def test_del(): req_str = 'python code' db_cla.set_req(req_str) result1 = db_cla.del_req('python') result2 = db_cla.get_req('python') assert result1 == 'OK' and result2 == 'None'
def test_get(): db_cla.set_req(['hello', 'world']) result = db_cla.get_req(['name']) assert result == 'hello'