Skip to content

Commit

Permalink
change variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
kounelisagis committed Mar 26, 2024
1 parent e874bbd commit 401bf93
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions tiledb/tests/test_consolidation_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,27 @@ def test_consolidation_plan(self):
tiledb.from_numpy(path, array)

with tiledb.open(path, "r") as A:
xxx = tiledb.ConsolidationPlan(tiledb.default_ctx(), A, 2)
assert xxx.num_nodes == 1
assert xxx.num_fragments(0) == 1
cons_plan = tiledb.ConsolidationPlan(tiledb.default_ctx(), A, 2)
assert cons_plan.num_nodes == 1
assert cons_plan.num_fragments(0) == 1
# check that it has a nodes key
assert "nodes" in json.loads(xxx.dump())
assert "nodes" in json.loads(cons_plan.dump())
# check that it has a list of nodes
assert isinstance(json.loads(xxx.dump())["nodes"], list)
assert isinstance(json.loads(cons_plan.dump())["nodes"], list)
# check that each node has a uri key
assert "uri" in json.loads(xxx.dump())["nodes"][0]["uris"][0]
assert "uri" in json.loads(cons_plan.dump())["nodes"][0]["uris"][0]

# write a second fragment to the array
with tiledb.open(path, "w") as A:
A[:] = np.random.rand(4)

with tiledb.open(path, "r") as A:
xxx = tiledb.ConsolidationPlan(tiledb.default_ctx(), A, 4)
assert xxx.num_nodes == 1
assert xxx.num_fragments(0) == 2
cons_plan = tiledb.ConsolidationPlan(tiledb.default_ctx(), A, 4)
assert cons_plan.num_nodes == 1
assert cons_plan.num_fragments(0) == 2
# check that it has a nodes key
assert "nodes" in json.loads(xxx.dump())
assert "nodes" in json.loads(cons_plan.dump())
# check that it has a list of nodes
assert isinstance(json.loads(xxx.dump())["nodes"], list)
assert isinstance(json.loads(cons_plan.dump())["nodes"], list)
# check that each node has a uri key
assert "uri" in json.loads(xxx.dump())["nodes"][0]["uris"][0]
assert "uri" in json.loads(cons_plan.dump())["nodes"][0]["uris"][0]

0 comments on commit 401bf93

Please sign in to comment.