Skip to content

Test: JupyterLab Trash feature works via API #1226

Open
@coderabbitai

Description

@coderabbitai

Follow-up from PR #1218
(reference comment: #1218 (comment)).

Implement a test that:

  • Creates a file via the JupyterLab API.
  • Moves it to Trash using the API (e.g. PATCH /api/contents/ with {"trash": true}).
  • Verifies the file appears in the Trash folder.

Sample code:

import requests

def test_jlab_trash_feature():
    base = "http://localhost:8888"
    fname = "deleteme.txt"
    # Create file
    requests.put(f"{base}/api/contents/{fname}", json={"type": "file", "content": "test", "format": "text"})
    # Move to trash
    r = requests.patch(f"{base}/api/contents/{fname}", json={"trash": True})
    assert r.status_code == 200
    # List Trash (may require custom API or check .trash folder)
    # r = requests.get(f"{base}/api/contents/.trash")
    # assert fname in [f["name"] for f in r.json().get("content",[])]

Owner: @jiridanek

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions