Skip to content
This repository has been archived by the owner on Oct 5, 2023. It is now read-only.

Commit

Permalink
fix: fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
farhan committed Oct 2, 2023
1 parent 0294eae commit fd0723f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/unit/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def test_theme_files_are_loaded_from_correct_package(self, xblock_class):
package_name = 'some_package'
theme_config = {xblock_class.theme_key: {'package': package_name, 'locations': ['lms.css']}}
self.service_mock.get_settings_bucket = Mock(return_value=theme_config)
with patch("xblockutils.settings.ResourceLoader") as patched_resource_loader:
with patch("xblock.utils.settings.ResourceLoader") as patched_resource_loader:
xblock.include_theme_files(fragment)
patched_resource_loader.assert_called_with(package_name)

Expand All @@ -133,7 +133,7 @@ def test_theme_files_are_added_to_fragment(self, package_name, locations):
fragment = MagicMock()
theme_config = {DummyXBlockWithSettings.theme_key: {'package': package_name, 'locations': locations}}
self.service_mock.get_settings_bucket = Mock(return_value=theme_config)
with patch("xblockutils.settings.ResourceLoader.load_unicode") as patched_load_unicode:
with patch("xblock.utils.settings.ResourceLoader.load_unicode") as patched_load_unicode:
xblock.include_theme_files(fragment)
for location in locations:
patched_load_unicode.assert_any_call(location)
Expand All @@ -146,6 +146,6 @@ def test_invalid_default_theme_config(self, theme_config):
xblock.default_theme_config = theme_config
self.service_mock.get_settings_bucket = Mock(return_value={})
fragment = MagicMock()
with patch("xblockutils.settings.ResourceLoader.load_unicode") as patched_load_unicode:
with patch("xblock.utils.settings.ResourceLoader.load_unicode") as patched_load_unicode:
xblock.include_theme_files(fragment)
patched_load_unicode.assert_not_called()

0 comments on commit fd0723f

Please sign in to comment.