MCPcopy
hub / github.com/redis/redis-py / test_create

Function test_create

tests/test_timeseries.py:35–49  ·  view source on GitHub ↗
(client)

Source from the content-addressed store, hash-verified

33
34@pytest.mark.redismod
35def test_create(client):
36 assert client.ts().create(1)
37 assert client.ts().create(2, retention_msecs=5)
38 assert client.ts().create(3, labels={"Redis": "Labs"})
39 assert client.ts().create(4, retention_msecs=20, labels={"Time": "Series"})
40 info = client.ts().info(4)
41 assert_resp_response(
42 client, 20, info.get("retention_msecs"), info.get("retentionTime")
43 )
44 assert "Series" == info["labels"]["Time"]
45
46 # Test for a chunk size of 128 Bytes
47 assert client.ts().create("time-serie-1", chunk_size=128)
48 info = client.ts().info("time-serie-1")
49 assert_resp_response(client, 128, info.get("chunk_size"), info.get("chunkSize"))
50
51
52@pytest.mark.redismod

Callers

nothing calls this directly

Calls 5

assert_resp_responseFunction · 0.85
createMethod · 0.45
tsMethod · 0.45
infoMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected