test_project.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:kapsel 作者: conda 项目源码 文件源码
def test_bokeh_command_with_kapsel_http_args():
    def check(dirname):
        project = project_no_dedicated_env(dirname)
        command = project.default_command
        assert command.bokeh_app == 'test.py'
        assert command.notebook is None
        assert command.unix_shell_commandline is None
        assert command.windows_cmd_commandline is None
        assert command.conda_app_entry is None
        assert command.supports_http_options

        environ = minimal_environ(PROJECT_DIR=dirname)
        cmd_exec = command.exec_info_for_environment(
            environ,
            extra_args=['--foo', '--kapsel-url-prefix', 'blah', '--kapsel-port', '1234', '--kapsel-host', 'example.com',
                        '--kapsel-no-browser', '--kapsel-iframe-hosts=foo1.com *.foo2.com', '--kapsel-use-xheaders'])
        path = os.pathsep.join([environ['PROJECT_DIR'], environ['PATH']])
        bokeh = find_executable('bokeh', path)
        assert cmd_exec.args == [bokeh, 'serve', os.path.join(dirname, 'test.py'), '--host', 'example.com', '--port',
                                 '1234', '--prefix', 'blah', '--use-xheaders', '--foo']
        assert cmd_exec.shell is False

    with_directory_contents_completing_project_file(
        {DEFAULT_PROJECT_FILENAME: "commands:\n default:\n    bokeh_app: test.py\n"}, check)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号