MCPcopy
hub / github.com/django/django / test_bpython

Method test_bpython

tests/shell/tests.py:169–179  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

167 call_command("shell", interface="ipython")
168
169 def test_bpython(self):
170 cmd = shell.Command()
171 mock_bpython = mock.Mock(embed=mock.MagicMock())
172 options = {"verbosity": 0, "no_imports": False}
173
174 with mock.patch.dict(sys.modules, {"bpython": mock_bpython}):
175 cmd.bpython(options)
176
177 self.assertEqual(
178 mock_bpython.embed.mock_calls, [mock.call(cmd.get_namespace(**options))]
179 )
180
181 @mock.patch("django.core.management.commands.shell.select.select") # [1]
182 @mock.patch.dict("sys.modules", {"bpython": None})

Callers

nothing calls this directly

Calls 4

bpythonMethod · 0.95
get_namespaceMethod · 0.95
dictMethod · 0.80
callMethod · 0.80

Tested by

no test coverage detected