本文整理汇总了Python中TestEnv.TestEnv.init方法的典型用法代码示例。如果您正苦于以下问题:Python TestEnv.init方法的具体用法?Python TestEnv.init怎么用?Python TestEnv.init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestEnv.TestEnv
的用法示例。
在下文中一共展示了TestEnv.init方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup_module
# 需要导入模块: from TestEnv import TestEnv [as 别名]
# 或者: from TestEnv.TestEnv import init [as 别名]
def setup_module(module):
print("setup_module: %s" % module.__name__)
TestEnv.init()
HttpdConf(
).start_vhost( TestEnv.HTTPS_PORT, "push", docRoot="htdocs/test1", withSSL=True
).add_line(""" Protocols h2 http/1.1"
RewriteEngine on
RewriteRule ^/006-push(.*)?\.html$ /006.html
<Location /006-push.html>
Header add Link "</006/006.css>;rel=preload"
Header add Link "</006/006.js>;rel=preloadX"
</Location>
<Location /006-push2.html>
Header add Link "</006/006.css>;rel=preloadX, </006/006.js>; rel=preload"
</Location>
<Location /006-push3.html>
Header add Link "</006/006.css>;rel=preloa,</006/006.js>;rel=preload"
</Location>
<Location /006-push4.html>
Header add Link "</006/006.css;rel=preload, </006/006.js>; preload"
</Location>
<Location /006-push5.html>
Header add Link '</006/006.css>;rel="preload push"'
</Location>
<Location /006-push6.html>
Header add Link '</006/006.css>;rel="push preload"'
</Location>
<Location /006-push7.html>
Header add Link '</006/006.css>;rel="abc preload push"'
</Location>
<Location /006-push8.html>
Header add Link '</006/006.css>;rel="preload"; nopush'
</Location>
<Location /006-push20.html>
H2PushResource "/006/006.css" critical
H2PushResource "/006/006.js"
</Location>
<Location /006-push30.html>
H2Push off
Header add Link '</006/006.css>;rel="preload"'
</Location>
<Location /006-push31.html>
H2PushResource "/006/006.css" critical
</Location>
<Location /006-push32.html>
Header add Link "</006/006.css>;rel=preload"
</Location>
""").end_vhost(
).install()
assert TestEnv.apache_restart() == 0
示例2: setup_module
# 需要导入模块: from TestEnv import TestEnv [as 别名]
# 或者: from TestEnv.TestEnv import init [as 别名]
def setup_module(module):
print("setup_module: %s" % module.__name__)
TestEnv.init()
HttpdConf(
).start_vhost( TestEnv.HTTPS_PORT, "hints", docRoot="htdocs/test1", withSSL=True
).add_line(""" Protocols h2 http/1.1"
H2EarlyHints on
RewriteEngine on
RewriteRule ^/006-(.*)?\.html$ /006.html
<Location /006-hints.html>
H2PushResource "/006/006.css" critical
</Location>
<Location /006-nohints.html>
Header add Link "</006/006.css>;rel=preload"
</Location>
""").end_vhost(
).install()
assert TestEnv.apache_restart() == 0
示例3: setup_module
# 需要导入模块: from TestEnv import TestEnv [as 别名]
# 或者: from TestEnv.TestEnv import init [as 别名]
def setup_module(module):
print("setup_module: %s" % module.__name__)
TestEnv.init()
HttpdConf(
).start_vhost( TestEnv.HTTPS_PORT, "ssl", withSSL=True
).add_line(" Protocols h2 http/1.1"
).add_line(" SSLOptions +StdEnvVars"
).add_line(" "
).add_line(" <Location /h2only.html>"
).add_line(" Require expr \"%{HTTP2} == 'on'\""
).add_line(" </Location>"
).add_line(" <Location /noh2.html>"
).add_line(" Require expr \"%{HTTP2} == 'off'\""
).add_line(" </Location>"
).end_vhost(
).install()
# the dir needs to exists for the configuration to have effect
TestEnv.mkpath("%s/htdocs/ssl-client-verify" % TestEnv.WEBROOT)
assert TestEnv.apache_restart() == 0
示例4: setup_module
# 需要导入模块: from TestEnv import TestEnv [as 别名]
# 或者: from TestEnv.TestEnv import init [as 别名]
def setup_module(module):
print("setup_module: %s" % module.__name__)
TestEnv.init()
HttpdConf().add_vhost_test1().add_vhost_test2().add_vhost_noh2(
).start_vhost( TestEnv.HTTPS_PORT, "test3", docRoot="htdocs/test1", withSSL=True
).add_line(" Protocols h2 http/1.1"
).add_line(" Header unset Upgrade"
).end_vhost(
).start_vhost( TestEnv.HTTP_PORT, "test1b", docRoot="htdocs/test1", withSSL=False
).add_line(" Protocols h2c http/1.1"
).add_line(" H2Upgrade off"
).add_line(" <Location /006.html>"
).add_line(" H2Upgrade on"
).add_line(" </Location>"
).end_vhost(
).install()
# the dir needs to exists for the configuration to have effect
TestEnv.mkpath("%s/htdocs/ssl-client-verify" % TestEnv.WEBROOT)
assert TestEnv.apache_restart() == 0
示例5: setup_module
# 需要导入模块: from TestEnv import TestEnv [as 别名]
# 或者: from TestEnv.TestEnv import init [as 别名]
def setup_module(module):
print("setup_module: %s" % module.__name__)
TestEnv.init()
HttpdConf(
).add_line(" SSLCipherSuite ECDHE-RSA-AES256-GCM-SHA384"
).add_line(" <Directory \"%s/htdocs/ssl-client-verify\">" % TestEnv.WEBROOT
).add_line(" Require all granted"
).add_line(" SSLVerifyClient require"
).add_line(" SSLVerifyDepth 0"
).add_line(" </Directory>"
).start_vhost( TestEnv.HTTPS_PORT, "ssl", withSSL=True
).add_line(" Protocols h2 http/1.1"
).add_line(" "
).add_line(" <Location /renegotiate/cipher>"
).add_line(" SSLCipherSuite ECDHE-RSA-CHACHA20-POLY1305"
).add_line(" </Location>"
).add_line(" <Location /renegotiate/err-doc-cipher>"
).add_line(" SSLCipherSuite ECDHE-RSA-CHACHA20-POLY1305"
).add_line(" ErrorDocument 403 /forbidden.html"
).add_line(" </Location>"
).add_line(" <Location /renegotiate/verify>"
).add_line(" SSLVerifyClient require"
).add_line(" </Location>"
).add_line(" <Directory \"%s/htdocs/sslrequire\">" % TestEnv.WEBROOT
).add_line(" SSLRequireSSL"
).add_line(" </Directory>"
).add_line(" <Directory \"%s/htdocs/requiressl\">" % TestEnv.WEBROOT
).add_line(" Require ssl"
).add_line(" </Directory>"
).end_vhost(
).install()
# the dir needs to exists for the configuration to have effect
TestEnv.mkpath("%s/htdocs/ssl-client-verify" % TestEnv.WEBROOT)
TestEnv.mkpath("%s/htdocs/renegotiate/cipher" % TestEnv.WEBROOT)
TestEnv.mkpath("%s/htdocs/sslrequire" % TestEnv.WEBROOT)
TestEnv.mkpath("%s/htdocs/requiressl" % TestEnv.WEBROOT)
assert TestEnv.apache_restart() == 0
示例6: setup_module
# 需要导入模块: from TestEnv import TestEnv [as 别名]
# 或者: from TestEnv.TestEnv import init [as 别名]
def setup_module(module):
print("setup_module: %s" % module.__name__)
TestEnv.init()
HttpdConf().add_vhost_cgi().install()
assert TestEnv.apache_restart() == 0
示例7: setup_module
# 需要导入模块: from TestEnv import TestEnv [as 别名]
# 或者: from TestEnv.TestEnv import init [as 别名]
def setup_module(module):
print("setup_module: %s" % module.__name__)
TestEnv.init()
TestEnv.setup_data_1k_1m()
HttpdConf().add_vhost_cgi( h2proxy_self=True ).install()
assert TestEnv.apache_restart() == 0
示例8: setup_module
# 需要导入模块: from TestEnv import TestEnv [as 别名]
# 或者: from TestEnv.TestEnv import init [as 别名]
def setup_module(module):
print("setup_module: %s" % module.__name__)
TestEnv.init()
HttpdConf().install()
示例9: setup_module
# 需要导入模块: from TestEnv import TestEnv [as 别名]
# 或者: from TestEnv.TestEnv import init [as 别名]
def setup_module(module):
print("setup_module: %s" % module.__name__)
TestEnv.init()
TestEnv.setup_data_1k_1m()