openedx / openedx/xblocks-core
test: port test_video_handlers.py coverage (handler dispatch, transcripts)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 0
- Forks
- 15
- Avg merge
- 5d 16m
- Merged PRs (30d)
- 7
Description
Context
As part of the Slash-n-Burn Built-In XBlocks epic (openedx-platform#37819), the file `lms/djangoapps/courseware/tests/test_video_handlers.py` was deleted from openedx-platform in PR #38750.
This test file covered `VideoBlock` handler logic that now lives in xblocks-contrib. The coverage was not ported before deletion.
What needs to be ported
`test_video_handlers.py` covered:
- Handler dispatch — `handle_ajax`, routing to sub-handlers
- Transcript download/upload/delete — `transcript`, `save_transcript`, `delete_transcript` handlers
- Transcript language/content negotiation — SRT vs SJSON format selection, language fallback
- Video position tracking — `save_user_state` handler
- Metadata save — `metadata_save` handler, field validation
The `video_handlers.py` module in xblocks-contrib is entirely untested at the handler level.
Acceptance Criteria
- Port equivalent tests into `xblocks_contrib/tests/` (or an appropriate subpackage)
- Tests should pass against the xblocks-contrib VideoBlock without importing from xmodule
- CI must remain green
Related
- openedx-platform PR: #38750
- Epic: openedx-platform#37819
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with video_handlers.py and inspect the deleted lms/djangoapps/courseware/tests/test_video_handlers.py through openedx-platform PR #38750 for the original cases. Port handler-dispatch, transcript, position-tracking, and metadata-save coverage into xblocks_contrib/tests/, then run the test suite and confirm it passes without importing from xmodule.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, testing
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100