Skip to content

Commit 505796b

Browse files
committed
Removed test case from test_access_control
1 parent c29b1d6 commit 505796b

File tree

1 file changed

+0
-44
lines changed

1 file changed

+0
-44
lines changed

tests/test_access_control.py

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import asyncio
2-
import time
31
import json
42
import sqlite3
53
from copy import deepcopy
@@ -673,48 +671,6 @@ def test_deletion_access_control(access_control_test_context_factory):
673671
alice_client[top]["data_H"].delete(external_only=False)
674672

675673

676-
async def coro_test(c, keys):
677-
asyncio.sleep(0.5)
678-
child_node = await c.context.http_client.app.state.root_tree[keys[0]].lookup_adapter(
679-
[keys[1]]
680-
)
681-
return child_node
682-
683-
684-
def test_created_and_updated_info(access_control_test_context_factory):
685-
"""
686-
Test that created_by and updated_by fields are correctly set
687-
on node creation and metadata update.
688-
"""
689-
690-
alice_client = access_control_test_context_factory("alice", "alice")
691-
chris_client = access_control_test_context_factory("chris", "chris")
692-
693-
top = "foo"
694-
for data in ["data_M"]:
695-
# Create a new node and check created_by and updated_by
696-
chris_client[top].write_array(
697-
arr,
698-
key=data,
699-
metadata={"description": "initial"},
700-
access_tags=["chris_tag"],
701-
)
702-
coro_obj = coro_test(chris_client, [top, data])
703-
result = asyncio.run(coro_obj)
704-
assert result.node.created_by == "alice"
705-
assert result.node.updated_by == "alice"
706-
assert result.node.time_created.date() == result.node.time_updated.date()
707-
708-
time.sleep(1) # ensure time_updated is different
709-
alice_client[top][data].replace_metadata(
710-
metadata={"description": "updated"}
711-
) # Still need to test this works with another user
712-
coro_obj = coro_test(alice_client, [top, data])
713-
result = asyncio.run(coro_obj)
714-
assert result.node.created_by != result.node.updated_by
715-
assert result.node.time_created != result.node.time_updated
716-
717-
718674
def test_user_owned_node_access_control(access_control_test_context_factory):
719675
"""
720676
Test that user-owned nodes (i.e. nodes created without access tags applied)

0 commit comments

Comments
 (0)