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


Python functions.valid_content函数代码示例

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


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

示例1: test_save_none

 def test_save_none(self):
     mock = self.mock_valid()
     mock["nome"] = "InterfaceNone"
     mock[self.KEY_ATTR] = self.NONE_ATTR
     response = self.save({self.XML_KEY: mock})
     valid_response(response)
     valid_content(response, self.XML_KEY)
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:7,代码来源:test_Interface.py

示例2: test_save_ipv4_valid

 def test_save_ipv4_valid(self):
     mock = self.mock_network_ip_valid()
     mock[self.KEY_ATTR] = 26
     response = self.client_autenticado().postXML(
         self.URL_SAVE_NETWORK_IPV4, {self.XML_KEY_NETWORK_IP: mock})
     valid_response(response)
     valid_content(response, self.XML_KEY_NETWORK_IP)
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:7,代码来源:test_Network.py

示例3: test_save_ipv6_valid

 def test_save_ipv6_valid(self):
     mock = self.mock_network_hosts_ip_valid()
     mock['id_vlan'] = 17
     response = self.client_autenticado().putXML(
         self.URL_SAVE_NETWORK_IPV6, {self.XML_KEY_NETWORK_IP: mock})
     valid_response(response)
     valid_content(response, self.XML_KEY_NETWORK_IP)
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:7,代码来源:test_Network.py

示例4: test_save_valid

    def test_save_valid(self):
        mock = self.mock_valid()
        response = self.save({self.XML_KEY: mock})
        valid_response(response)
        content = valid_content(response, self.XML_KEY)

        response = self.search(id_env_vip=content["id"])
        valid_response(response)
        env_vip = valid_content(response, self.XML_KEY)
        self.valid_attr(mock, env_vip)
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:10,代码来源:test_EnvironmentVIP.py

示例5: test_save_networkIpv6_set_first_available_ip_valid

    def test_save_networkIpv6_set_first_available_ip_valid(self):
        mock = self.mock_networkIpv6_set_first_available_ip_valid()
        response = self.save({self.XML_KEY: mock})
        valid_response(response)
        response_dict = valid_content(response, self.XML_KEY)

        response = self.client_autenticado().get(
            self.URL_GET_IPS_BY_IPV6_ID % response_dict['id'])
        valid_response(response)
        valid_content(response, self.XML_KEY_IPS_NETWORK, True)
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:10,代码来源:test_Network.py

示例6: test_save_valid

    def test_save_valid(self):
        mock = self.mock_valid()
        response = self.save({self.XML_KEY: mock})
        valid_response(response)
        group_user = valid_content(response, self.XML_KEY)

        response = self.get_by_id(group_user['id'])
        valid_response(response)
        content = valid_content(response, self.XML_KEY)
        self.valid_attr(mock, content)
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:10,代码来源:test_GroupUser.py

示例7: test_associate_valid

    def test_associate_valid(self):
        response = self.client_autenticado().put(
            self.URL_ASSOCIATE % (self.ID_VALID, self.ID_TYPE_EQUIPMENT))
        valid_response(response)
        valid_content(response, "equiptype_filter_xref")

        # Remove filter association so it does not require cleaning db manually
        response = self.client_autenticado().put(
            self.URL_DISSOCIATE % (self.ID_VALID, self.ID_TYPE_EQUIPMENT))
        valid_response(response)
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:10,代码来源:test_Filter.py

示例8: test_save_valid

    def test_save_valid(self):
        mock = self.mock_valid()
        response = self.save({self.XML_KEY: mock})
        valid_response(response)
        content = valid_content(response, self.XML_KEY)

        response = self.get_by_id(content["id"])
        valid_response(response)
        ovip = valid_content(response, self.XML_KEY)

        self.valid_attr(mock, ovip)
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:11,代码来源:test_OptionVIP.py

示例9: test_save_valid

    def test_save_valid(self):
        mock = self.mock_valid()
        response = self.save({self.XML_KEY: mock})
        valid_response(response)
        content = valid_content(response, "perm")

        response = self.get_by_id(content["id"])
        valid_response(response)
        perm = valid_content(response, "perm")

        self.valid_attr(mock, perm)
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:11,代码来源:test_PermissionAdministrative.py

示例10: test_save_networkIpv6AddResource_set_first_available_ip_valid

    def test_save_networkIpv6AddResource_set_first_available_ip_valid(self):
        mock = self.mock_networkIpv6AddResource_set_first_available_ip_valid()
        response = self.client_autenticado().postXML(
            self.URL_SAVE_NETWORK_IPV6, {self.XML_KEY_NETWORK_IP: mock})
        valid_response(response)
        response_dict = valid_content(response, self.XML_KEY_NETWORK_IP)

        response = self.client_autenticado().get(
            self.URL_GET_IPS_BY_IPV6_ID % response_dict['id_network'])
        valid_response(response)
        valid_content(response, self.XML_KEY_IPS_NETWORK, True)
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:11,代码来源:test_Network.py

示例11: test_associate_valid

    def test_associate_valid(self):
        response = self.client_autenticado().put(
            self.URL_ASSOCIATE % (self.ID_OPTION_VIP_FOR_ASSOCIATION, self.ID_ENV_VIP_FOR_ASSOCIATION)
        )
        valid_response(response)
        valid_content(response, "opcoesvip_ambiente_xref")

        # Dissociate so it does not require cleaning db manually
        response = self.client_autenticado().delete(
            self.URL_DISSOCIATE % (self.ID_OPTION_VIP_FOR_ASSOCIATION, self.ID_ENV_VIP_FOR_ASSOCIATION)
        )
        valid_response(response)
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:12,代码来源:test_OptionVIP.py

示例12: test_save_valid

    def test_save_valid(self):
        mock = self.mock_valid()
        response = self.save({self.XML_KEY: mock})
        valid_response(response)
        brand = valid_content(response, "brand")

        response = self.get_all()
        valid_response(response)
        content = valid_content(response, "brand")

        for brd in content:
            if brd["id"] == brand["id"]:
                self.valid_attr(mock, brd)
                break
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:14,代码来源:test_Brand.py

示例13: test_save_valid

    def test_save_valid(self):
        mock = self.mock_valid()
        response = self.save({self.XML_KEY: mock})
        valid_response(response)
        script = valid_content(response, "script")

        response = self.get_all()
        valid_response(response)
        content = valid_content(response, "script")

        for scr in content:
            if scr["id"] == script["id"]:
                self.valid_attr(mock, scr)
                break
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:14,代码来源:test_Script.py

示例14: test_save_valid

    def test_save_valid(self):
        mock = self.mock_valid()
        response = self.save({self.XML_KEY: mock})
        valid_response(response)
        divisiondc = valid_content(response, "division_dc")

        response = self.get_all()
        valid_response(response)
        content = valid_content(response, "division_dc")

        for ddc in content:
            if ddc["id"] == divisiondc["id"]:
                self.valid_attr(mock, ddc)
                break
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:14,代码来源:test_DivisionDc.py

示例15: test_save_valid

    def test_save_valid(self):
        mock = self.mock_valid()
        response = self.save({self.XML_KEY: mock})
        valid_response(response)
        content = valid_content(response, "usuario")

        response = self.get_by_id(content["id"])
        valid_response(response)
        user = valid_content(response, "usuario")

        assert bool(user["ativo"]) == True

        mock['password'] = hashlib.md5(mock['password']).hexdigest()
        self.valid_attr(mock, user)
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:14,代码来源:test_User.py


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