Skip to content

Commit

Permalink
fix: deprecated runtime tests
Browse files Browse the repository at this point in the history
  • Loading branch information
irtazaakram committed Oct 25, 2023
1 parent b427fea commit a588282
Showing 1 changed file with 2 additions and 25 deletions.
27 changes: 2 additions & 25 deletions xblock/test/test_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
NoSuchHandlerError,
NoSuchServiceError,
NoSuchUsage,
NoSuchViewError,
FieldDataDeprecationWarning,
NoSuchViewError
)
from xblock.fields import BlockScope, Scope, String, ScopeIds, List, UserScope, Integer
from xblock.runtime import (
Expand All @@ -29,7 +28,7 @@
)
from xblock.field_data import DictFieldData, FieldData

from xblock.test.tools import unabc, WarningTestMixin, TestRuntime
from xblock.test.tools import unabc, TestRuntime


class TestMixin:
Expand Down Expand Up @@ -650,28 +649,6 @@ def test_missing_definition(self):
self.runtime.get_block(self.usage_id)


class TestRuntimeDeprecation(WarningTestMixin, TestCase):
"""
Tests to make sure that deprecated Runtime apis stay usable,
but raise warnings.
"""

def test_passed_field_data(self):
field_data = Mock(spec=FieldData)
with self.assertWarns(FieldDataDeprecationWarning):
runtime = TestRuntime(Mock(spec=IdReader), field_data)
with self.assertWarns(FieldDataDeprecationWarning):
self.assertEqual(runtime.field_data, field_data)

def test_set_field_data(self):
field_data = Mock(spec=FieldData)
runtime = TestRuntime(Mock(spec=IdReader), None)
with self.assertWarns(FieldDataDeprecationWarning):
runtime.field_data = field_data
with self.assertWarns(FieldDataDeprecationWarning):
self.assertEqual(runtime.field_data, field_data)


class RuntimeWithCustomCSS(TestRuntime): # pylint: disable=abstract-method
"""
A runtime that adds extra CSS classes to rendered XBlocks
Expand Down

0 comments on commit a588282

Please sign in to comment.