Skip to content

Commit 20de95c

Browse files
committed
chore: Add change requests
1 parent 79ecec6 commit 20de95c

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

docs/xblock-tutorial/getting_started/prereqs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Python 3.11
1616
***********
1717

1818
To run the a virtual environment and the XBlock SDK, and to build an XBlock,
19-
you must have Python 3.1 installed on your computer.
19+
you must have Python 3.11 installed on your computer.
2020

2121
`Download Python`_ for your operating system and follow the installation
2222
instructions.

xblock/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,10 @@ def open_local_resource(cls, uri):
157157
if "/." in uri:
158158
raise DisallowedFileError("Only safe file names are allowed: %r" % uri)
159159

160-
return cls.open_resource(uri)
160+
return cls._open_resource(uri)
161161

162162
@classmethod
163-
def open_resource(cls, uri):
163+
def _open_resource(cls, uri):
164164
return importlib.resources.files(inspect.getmodule(cls).__package__).joinpath(
165165
os.path.join(cls.resources_dir, uri)
166166
).open('rb')

xblock/test/test_core.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ class UnloadableXBlock(XBlock):
962962
resources_dir = None
963963

964964
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."""
966966
return "!" + uri + "!"
967967

968968
@ddt.data(
@@ -975,7 +975,7 @@ def stub_open_resource(self, uri):
975975
)
976976
def test_open_good_local_resource(self, uri):
977977
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):
979979
assert loadable.open_local_resource(uri) == "!" + uri + "!"
980980
assert loadable.open_local_resource(uri.encode('utf-8')) == "!" + uri + "!"
981981

@@ -989,7 +989,7 @@ def test_open_good_local_resource(self, uri):
989989
)
990990
def test_open_good_local_resource_binary(self, uri):
991991
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):
993993
assert loadable.open_local_resource(uri) == "!" + uri.decode('utf-8') + "!"
994994

995995
@ddt.data(
@@ -1003,7 +1003,7 @@ def test_open_good_local_resource_binary(self, uri):
10031003
)
10041004
def test_open_bad_local_resource(self, uri):
10051005
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):
10071007
msg_pattern = ".*: %s" % re.escape(repr(uri))
10081008
with pytest.raises(DisallowedFileError, match=msg_pattern):
10091009
loadable.open_local_resource(uri)
@@ -1019,7 +1019,7 @@ def test_open_bad_local_resource(self, uri):
10191019
)
10201020
def test_open_bad_local_resource_binary(self, uri):
10211021
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):
10231023
msg = ".*: %s" % re.escape(repr(uri.decode('utf-8')))
10241024
with pytest.raises(DisallowedFileError, match=msg):
10251025
loadable.open_local_resource(uri)
@@ -1042,7 +1042,7 @@ def test_open_bad_local_resource_binary(self, uri):
10421042
def test_open_local_resource_with_no_resources_dir(self, uri):
10431043
unloadable = self.UnloadableXBlock(None, scope_ids=Mock())
10441044

1045-
with patch('xblock.core.Blocklike.open_resource', self.stub_open_resource):
1045+
with patch('xblock.core.Blocklike._open_resource', self.stub_open_resource):
10461046
msg = "not configured to serve local resources"
10471047
with pytest.raises(DisallowedFileError, match=msg):
10481048
unloadable.open_local_resource(uri)

0 commit comments

Comments
 (0)