当前位置: 首页>>代码示例>>Python>>正文


Python vhost.VHost类代码示例

本文整理汇总了Python中vhost.VHost的典型用法代码示例。如果您正苦于以下问题:Python VHost类的具体用法?Python VHost怎么用?Python VHost使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了VHost类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_to_lxml_full

 def test_to_lxml_full(self):
     vhost = VHost('test vhost', 80, 'HTTP', '/www', '/system',
                   [Log('ACCESSLOG'), Log('WARNINGLOG')],
                   ['127.0.0.0/8', '192.168.0.0/16'],
                   {'host.domain': True, 'test.domain': None},
                   'private_key', 'certificate')
     copy = VHost.from_lxml_element(vhost.to_lxml_element())
     self.assertEqual(vhost, copy)
开发者ID:rupinder,项目名称:GNU-MyServer-GSoC,代码行数:8,代码来源:vhost_test.py

示例2: test_name

 def test_name(self):
     vhost = VHost('test vhost')
     self.assertEqual('test vhost', vhost.get_name())
     vhost.set_name('vhost')
     self.assertEqual('vhost', vhost.get_name())
     vhost.set_name(None)
     self.assertEqual(None, vhost.get_name())
     vhost = VHost(name = 'test vhost')
     self.assertEqual('test vhost', vhost.get_name())
开发者ID:rupinder,项目名称:GNU-MyServer-GSoC,代码行数:9,代码来源:vhost_test.py

示例3: test_sys_root

 def test_sys_root(self):
     vhost = VHost('test vhost', 80, 'HTTP', '/www', '/system')
     self.assertEqual('/system', vhost.get_sys_root())
     vhost.set_sys_root('/var/system')
     self.assertEqual('/var/system', vhost.get_sys_root())
     vhost.set_sys_root(None)
     self.assertEqual(None, vhost.get_sys_root())
     vhost = VHost(sys_root = '/system')
     self.assertEqual('/system', vhost.get_sys_root())
开发者ID:rupinder,项目名称:GNU-MyServer-GSoC,代码行数:9,代码来源:vhost_test.py

示例4: test_port

 def test_port(self):
     vhost = VHost('test vhost', 80)
     self.assertEqual(80, vhost.get_port())
     vhost.set_port(8080)
     self.assertEqual(8080, vhost.get_port())
     vhost.set_port(None)
     self.assertEqual(None, vhost.get_port())
     vhost = VHost(port = 80)
     self.assertEqual(80, vhost.get_port())
开发者ID:rupinder,项目名称:GNU-MyServer-GSoC,代码行数:9,代码来源:vhost_test.py

示例5: test_protocol

 def test_protocol(self):
     vhost = VHost('test vhost', 80, 'HTTP')
     self.assertEqual('HTTP', vhost.get_protocol())
     vhost.set_protocol('NEW PROTOCOL')
     self.assertEqual('NEW PROTOCOL', vhost.get_protocol())
     vhost.set_protocol(None)
     self.assertEqual(None, vhost.get_protocol())
     vhost = VHost(protocol = 'HTTP')
     self.assertEqual('HTTP', vhost.get_protocol())
开发者ID:rupinder,项目名称:GNU-MyServer-GSoC,代码行数:9,代码来源:vhost_test.py

示例6: _post_connect

 def _post_connect(self):
     """
     Called after a transport is established and authentication took place.
     """
     fs = self.get_sftp_filesystem()
     for vhname in fs.listdir(self.apache_available):
         vhost = VHost()
         vhost.name = vhname
         self.add_vhost(vhost)
         vhost.read_config()
开发者ID:BackupTheBerlios,项目名称:condensation-svn,代码行数:10,代码来源:server.py

示例7: test_vhost

    def test_vhost(self):
        text = '''
<VHOST custom="unknown">
  <PORT>123</PORT>
  <UNKNOWN>
    <CUSTOM />
  </UNKNOWN>
</VHOST>'''
        vhost = VHost.from_string(text)
        tree = vhost.to_lxml_element()
        self.assertEqual('unknown', tree.get('custom'))
        unknown = tree.findall('UNKNOWN')
        self.assertEqual(1, len(unknown))
        unknown = unknown[0]
        custom = list(unknown)
        self.assertEqual(1, len(custom))
        custom = custom[0]
        self.assertEqual('CUSTOM', custom.tag)
开发者ID:rupinder,项目名称:GNU-MyServer-GSoC,代码行数:18,代码来源:vhost_test.py

示例8: test_from_lxml_full

    def test_from_lxml_full(self):
        text = '''<VHOST>
  <NAME>test vhost</NAME>
  <PORT>80</PORT>
  <PROTOCOL>HTTP</PROTOCOL>
  <DOCROOT>/www</DOCROOT>
  <SYSROOT>/system</SYSROOT>
  <ACCESSLOG />
  <WARNINGLOG />
  <IP>127.0.0.0/8</IP>
  <IP>192.168.0.0/16</IP>
  <HOST useRegex="YES">host.domain</HOST>
  <HOST>test.domain</HOST>
  <SSL_PRIVATEKEY>private_key</SSL_PRIVATEKEY>
  <SSL_CERTIFICATE>certificate</SSL_CERTIFICATE>
</VHOST>'''
        vhost = VHost.from_lxml_element(etree.XML(text))
        right = VHost('test vhost', 80, 'HTTP', '/www', '/system',
                      [Log('ACCESSLOG'), Log('WARNINGLOG')],
                      ['127.0.0.0/8', '192.168.0.0/16'],
                      {'host.domain': True, 'test.domain': None},
                      'private_key', 'certificate')
        self.assertEqual(vhost, right)
开发者ID:rupinder,项目名称:GNU-MyServer-GSoC,代码行数:23,代码来源:vhost_test.py

示例9: test_to_lxml_host

 def test_to_lxml_host(self):
     vhost = VHost(host = {'.*': True, 'a.org': None})
     copy = VHost.from_lxml_element(vhost.to_lxml_element())
     self.assertEqual(vhost, copy)
开发者ID:rupinder,项目名称:GNU-MyServer-GSoC,代码行数:4,代码来源:vhost_test.py

示例10: test_to_lxml_ip

 def test_to_lxml_ip(self):
     vhost = VHost(ip = ['127.0.0.0/8'])
     copy = VHost.from_lxml_element(vhost.to_lxml_element())
     self.assertEqual(vhost, copy)
开发者ID:rupinder,项目名称:GNU-MyServer-GSoC,代码行数:4,代码来源:vhost_test.py

示例11: test_to_lxml_logs

 def test_to_lxml_logs(self):
     vhost = VHost(logs = [Log('ACCESSLOG'), Log('SOMELOG')])
     copy = VHost.from_lxml_element(vhost.to_lxml_element())
     self.assertEqual(vhost, copy)
开发者ID:rupinder,项目名称:GNU-MyServer-GSoC,代码行数:4,代码来源:vhost_test.py

示例12: test_to_lxml_sys_root

 def test_to_lxml_sys_root(self):
     vhost = VHost(sys_root = '/system')
     copy = VHost.from_lxml_element(vhost.to_lxml_element())
     self.assertEqual(vhost, copy)
开发者ID:rupinder,项目名称:GNU-MyServer-GSoC,代码行数:4,代码来源:vhost_test.py

示例13: test_to_string_sys_root

 def test_to_string_sys_root(self):
     vhost = VHost(sys_root = '/system')
     copy = VHost.from_string(str(vhost))
     self.assertEqual(vhost, copy)
开发者ID:rupinder,项目名称:GNU-MyServer-GSoC,代码行数:4,代码来源:vhost_test.py

示例14: test_to_string_name

 def test_to_string_name(self):
     vhost = VHost('test vhost')
     copy = VHost.from_string(str(vhost))
     self.assertEqual(vhost, copy)
开发者ID:rupinder,项目名称:GNU-MyServer-GSoC,代码行数:4,代码来源:vhost_test.py

示例15: test_to_string_protocol

 def test_to_string_protocol(self):
     vhost = VHost(protocol = 'HTTP')
     copy = VHost.from_string(str(vhost))
     self.assertEqual(vhost, copy)
开发者ID:rupinder,项目名称:GNU-MyServer-GSoC,代码行数:4,代码来源:vhost_test.py


注:本文中的vhost.VHost类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。