MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_5

Method test_5

Lib/test/test_pkg.py:183–210  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

181 self.run_code(s)
182
183 def test_5(self):
184 hier = [
185 ("t5", None),
186 ("t5 __init__.py", "import t5.foo"),
187 ("t5 string.py", "spam = 1"),
188 ("t5 foo.py",
189 "from . import string; assert string.spam == 1"),
190 ]
191 self.mkhier(hier)
192
193 import t5
194 s = """
195 from t5 import *
196 self.assertEqual(dir(), ['foo', 'self', 'string', 't5'])
197 """
198 self.run_code(s)
199
200 import t5
201 self.assertEqual(fixdir(dir(t5)),
202 ['__cached__', '__doc__', '__file__', '__loader__',
203 '__name__', '__package__', '__path__', '__spec__',
204 'foo', 'string', 't5'])
205 self.assertEqual(fixdir(dir(t5.foo)),
206 ['__cached__', '__doc__', '__file__', '__loader__',
207 '__name__', '__package__', '__spec__', 'string'])
208 self.assertEqual(fixdir(dir(t5.string)),
209 ['__cached__', '__doc__', '__file__', '__loader__',
210 '__name__', '__package__', '__spec__', 'spam'])
211
212 def test_6(self):
213 hier = [

Callers

nothing calls this directly

Calls 5

mkhierMethod · 0.95
run_codeMethod · 0.95
fixdirFunction · 0.85
dirFunction · 0.85
assertEqualMethod · 0.45

Tested by

no test coverage detected