Skip to content

Commit

Permalink
test: add test for override without base block
Browse files Browse the repository at this point in the history
  • Loading branch information
nsprenkle committed Aug 15, 2024
1 parent b1a21a2 commit 888cda7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions xblock/test/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ def test_plugin_override():
assert override is OverriddenBlock


@XBlock.register_temp_plugin(OverriddenBlock, "overridden_block", group='xblock.v1.overrides')
def test_plugin_override_missing_original():
# Trying to override a block that has no original block should raise an error
with pytest.raises(PluginMissingError, match="overridden_block"):
XBlock.load_class("overridden_block")


@XBlock.register_temp_plugin(AmbiguousBlock1, "overridden_block", group='xblock.v1.overrides')
@XBlock.register_temp_plugin(AmbiguousBlock2, "overridden_block", group='xblock.v1.overrides')
@XBlock.register_temp_plugin(OverriddenBlock, "overridden_block")
Expand Down

0 comments on commit 888cda7

Please sign in to comment.