當前位置: 首頁>>代碼示例>>Python>>正文


Python DnstestConfig.server_prod方法代碼示例

本文整理匯總了Python中pydnstest.config.DnstestConfig.server_prod方法的典型用法代碼示例。如果您正苦於以下問題:Python DnstestConfig.server_prod方法的具體用法?Python DnstestConfig.server_prod怎麽用?Python DnstestConfig.server_prod使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pydnstest.config.DnstestConfig的用法示例。


在下文中一共展示了DnstestConfig.server_prod方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_example_config_to_string

# 需要導入模塊: from pydnstest.config import DnstestConfig [as 別名]
# 或者: from pydnstest.config.DnstestConfig import server_prod [as 別名]
 def test_example_config_to_string(self):
     """ test converting the example config to a string """
     fpath = os.path.abspath("dnstest.ini.example")
     with open(fpath, 'r') as fh:
         expected = fh.read()
     dc = DnstestConfig()
     dc.server_prod = '1.2.3.4'
     dc.server_test = '1.2.3.5'
     dc.default_domain = '.example.com'
     dc.have_reverse_dns = True
     dc.ignore_ttl = False
     dc.sleep = 0.0
     result = dc.to_string()
     assert result == expected
開發者ID:,項目名稱:,代碼行數:16,代碼來源:

示例2: setup_verifies

# 需要導入模塊: from pydnstest.config import DnstestConfig [as 別名]
# 或者: from pydnstest.config.DnstestConfig import server_prod [as 別名]
    def setup_verifies(self):
        """
        Sets up test environment for tests of verify methods,
        including redefining resolve_name and lookup_reverse
        to the appropriate methods in this class
        """
        config = DnstestConfig()
        config.server_test = "test"
        config.server_prod = "prod"
        config.default_domain = ".example.com"
        config.have_reverse_dns = True

        chk = DNStestChecks(config)
        # stub
        chk.DNS.resolve_name = self.stub_resolve_name_verify
        # stub
        chk.DNS.lookup_reverse = self.stub_lookup_reverse_verify
        return chk
開發者ID:jantman,項目名稱:pydnstest,代碼行數:20,代碼來源:dnstest_check_change_test.py

示例3: setup_checks

# 需要導入模塊: from pydnstest.config import DnstestConfig [as 別名]
# 或者: from pydnstest.config.DnstestConfig import server_prod [as 別名]
    def setup_checks(self):
        global config
        global chk
        global parser
        config = DnstestConfig()
        config.server_test = "test_server_stub"
        config.server_prod = "prod_server_stub"
        config.default_domain = ".example.com"
        config.have_reverse_dns = True
        pydnstest.config = config

        parser = DnstestParser()
        pydnstest.parser = parser

        chk = DNStestChecks(config)
        # stub
        chk.DNS.resolve_name = self.stub_resolve_name
        # stub
        chk.DNS.lookup_reverse = self.stub_lookup_reverse
        pydnstest.chk = chk
        return (parser, chk)
開發者ID:jantman,項目名稱:pydnstest,代碼行數:23,代碼來源:dnstest_inputline_test.py

示例4: setup_checks

# 需要導入模塊: from pydnstest.config import DnstestConfig [as 別名]
# 或者: from pydnstest.config.DnstestConfig import server_prod [as 別名]
    def setup_checks(self):
        """
        Sets up test environment for tests of check methods,
        including redefining resolve_name and lookup_reverse
        to the appropriate methods in this class
        """
        config = DnstestConfig()
        config.server_test = "test"
        config.server_prod = "prod"
        config.default_domain = ".example.com"
        config.have_reverse_dns = True
        config.ignore_ttl = False

        parser = DnstestParser()
        pydnstest.parser = parser

        chk = DNStestChecks(config)
        # stub
        chk.DNS.resolve_name = self.stub_resolve_name
        # stub
        chk.DNS.lookup_reverse = self.stub_lookup_reverse
        return (parser, chk)
開發者ID:,項目名稱:,代碼行數:24,代碼來源:

示例5: setup_parser_return_unknown_op

# 需要導入模塊: from pydnstest.config import DnstestConfig [as 別名]
# 或者: from pydnstest.config.DnstestConfig import server_prod [as 別名]
    def setup_parser_return_unknown_op(self):
        """
        Sets up test environment for tests of check methods,
        including redefining resolve_name and lookup_reverse
        to the appropriate methods in this class
        """
        config = DnstestConfig()
        config.server_test = "test"
        config.server_prod = "prod"
        config.default_domain = ".example.com"
        config.have_reverse_dns = True

        parser = DnstestParser()
        # mock the parser function to just return None
        parser.parse_line = self.parser_return_unknown_op
        pydnstest.parser = parser

        chk = DNStestChecks(config)
        # stub
        chk.DNS.resolve_name = self.stub_resolve_name
        # stub
        chk.DNS.lookup_reverse = self.stub_lookup_reverse
        return (parser, chk)
開發者ID:jantman,項目名稱:pydnstest,代碼行數:25,代碼來源:dnstest_test.py


注:本文中的pydnstest.config.DnstestConfig.server_prod方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。