@@ -962,7 +962,7 @@ class UnloadableXBlock(XBlock):
962
962
resources_dir = None
963
963
964
964
def stub_open_resource (self , uri ):
965
- """Act like xblock.core.Blocklike.open_resource , for testing."""
965
+ """Act like xblock.core.Blocklike._open_resource , for testing."""
966
966
return "!" + uri + "!"
967
967
968
968
@ddt .data (
@@ -975,7 +975,7 @@ def stub_open_resource(self, uri):
975
975
)
976
976
def test_open_good_local_resource (self , uri ):
977
977
loadable = self .LoadableXBlock (None , scope_ids = Mock ())
978
- with patch ('xblock.core.Blocklike.open_resource ' , self .stub_open_resource ):
978
+ with patch ('xblock.core.Blocklike._open_resource ' , self .stub_open_resource ):
979
979
assert loadable .open_local_resource (uri ) == "!" + uri + "!"
980
980
assert loadable .open_local_resource (uri .encode ('utf-8' )) == "!" + uri + "!"
981
981
@@ -989,7 +989,7 @@ def test_open_good_local_resource(self, uri):
989
989
)
990
990
def test_open_good_local_resource_binary (self , uri ):
991
991
loadable = self .LoadableXBlock (None , scope_ids = Mock ())
992
- with patch ('xblock.core.Blocklike.open_resource ' , self .stub_open_resource ):
992
+ with patch ('xblock.core.Blocklike._open_resource ' , self .stub_open_resource ):
993
993
assert loadable .open_local_resource (uri ) == "!" + uri .decode ('utf-8' ) + "!"
994
994
995
995
@ddt .data (
@@ -1003,7 +1003,7 @@ def test_open_good_local_resource_binary(self, uri):
1003
1003
)
1004
1004
def test_open_bad_local_resource (self , uri ):
1005
1005
loadable = self .LoadableXBlock (None , scope_ids = Mock ())
1006
- with patch ('xblock.core.Blocklike.open_resource ' , self .stub_open_resource ):
1006
+ with patch ('xblock.core.Blocklike._open_resource ' , self .stub_open_resource ):
1007
1007
msg_pattern = ".*: %s" % re .escape (repr (uri ))
1008
1008
with pytest .raises (DisallowedFileError , match = msg_pattern ):
1009
1009
loadable .open_local_resource (uri )
@@ -1019,7 +1019,7 @@ def test_open_bad_local_resource(self, uri):
1019
1019
)
1020
1020
def test_open_bad_local_resource_binary (self , uri ):
1021
1021
loadable = self .LoadableXBlock (None , scope_ids = Mock ())
1022
- with patch ('xblock.core.Blocklike.open_resource ' , self .stub_open_resource ):
1022
+ with patch ('xblock.core.Blocklike._open_resource ' , self .stub_open_resource ):
1023
1023
msg = ".*: %s" % re .escape (repr (uri .decode ('utf-8' )))
1024
1024
with pytest .raises (DisallowedFileError , match = msg ):
1025
1025
loadable .open_local_resource (uri )
@@ -1042,7 +1042,7 @@ def test_open_bad_local_resource_binary(self, uri):
1042
1042
def test_open_local_resource_with_no_resources_dir (self , uri ):
1043
1043
unloadable = self .UnloadableXBlock (None , scope_ids = Mock ())
1044
1044
1045
- with patch ('xblock.core.Blocklike.open_resource ' , self .stub_open_resource ):
1045
+ with patch ('xblock.core.Blocklike._open_resource ' , self .stub_open_resource ):
1046
1046
msg = "not configured to serve local resources"
1047
1047
with pytest .raises (DisallowedFileError , match = msg ):
1048
1048
unloadable .open_local_resource (uri )
0 commit comments