Exemplo n.º 1
0
def test_set_script_from_file(use_cluster):
    sent_script = read_script_from_file()
    c = Client(None, use_cluster)
    c.set_script_from_file(
        "test-script-file", osp.join(file_path, "./data_processing_script.txt")
    )
    returned_script = c.get_script("test-script-file")
    assert sent_script == returned_script
Exemplo n.º 2
0
def test_set_get_function(use_cluster):
    c = Client(None, use_cluster)
    c.set_function("test-set-function", one_to_one)
    script = c.get_script("test-set-function")
    sent_script = inspect.getsource(one_to_one)
    assert script == sent_script
Exemplo n.º 3
0
def test_set_get_script(use_cluster):
    c = Client(None, use_cluster)
    sent_script = read_script_from_file()
    c.set_script("test-set-script", sent_script)
    script = c.get_script("test-set-script")
    assert sent_script == script
Exemplo n.º 4
0
def test_get_non_existant_script(use_cluster):
    c = Client(None, use_cluster)
    with pytest.raises(RedisReplyError):
        script = c.get_script("not-a-script")