diff options
| author | Jean-Philippe Camguilhem <jp.camguilhem@gmail.com> | 2011-11-20 21:45:21 +0100 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2011-11-21 20:47:55 -0600 |
| commit | 7bae406b11df0e3039798898e7951a09f31c0e53 (patch) | |
| tree | 385ecf6c1a22bd5280da71880db3f5758f4c56d2 | |
| parent | f1013bebcdd013cd1cb47cf7585c0eaa34ec3b75 (diff) | |
| download | pyramid-7bae406b11df0e3039798898e7951a09f31c0e53.tar.gz pyramid-7bae406b11df0e3039798898e7951a09f31c0e53.tar.bz2 pyramid-7bae406b11df0e3039798898e7951a09f31c0e53.zip | |
add test_command_loads_bpython_shell
| -rw-r--r-- | pyramid/tests/test_scripts/test_pshell.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/pyramid/tests/test_scripts/test_pshell.py b/pyramid/tests/test_scripts/test_pshell.py index 95bdce463..4f3853f91 100644 --- a/pyramid/tests/test_scripts/test_pshell.py +++ b/pyramid/tests/test_scripts/test_pshell.py @@ -82,6 +82,25 @@ class TestPShellCommand(unittest.TestCase): self.assertTrue(self.bootstrap.closer.called) self.assertTrue(shell.help) + def test_command_loads_bpython_shell(self): + command = self._makeOne() + shell = dummy.DummyBPythonShell() + command.make_bpython_shell = lambda: shell + command.options.enable_bpython = True + command.run() + self.assertTrue(self.config_factory.parser) + self.assertEqual(self.config_factory.parser.filename, + '/foo/bar/myapp.ini') + self.assertEqual(self.bootstrap.a[0], '/foo/bar/myapp.ini#myapp') + self.assertEqual(shell.locals_, { + 'app':self.bootstrap.app, 'root':self.bootstrap.root, + 'registry':self.bootstrap.registry, + 'request':self.bootstrap.request, + 'root_factory':self.bootstrap.root_factory, + }) + self.assertTrue(self.bootstrap.closer.called) + self.assertTrue(shell.banner) + def test_command_loads_default_shell_with_ipython_disabled(self): command = self._makeOne() shell = dummy.DummyShell() |
