• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python functions.valid_response函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: test_disconnect_no__write_permission

    def test_disconnect_no__write_permission(self):
        mock = self.mock_for_disconnect()
        self.alter(self.ID_FOR_CONNECTION, {self.XML_KEY: mock})

        response = self.client_no_write_permission().delete(
            self.URL_REMOVE_CONNECTION % (self.ID_DISCONNECT_VALID, "0"))
        valid_response(response, httplib.PAYMENT_REQUIRED)
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:7,代码来源:test_Interface.py


示例2: 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


示例3: test_get_by_equip_old_valid

 def test_get_by_equip_old_valid(self):
     response = self.client_autenticado().get(
         self.URL_GET_BY_EQUIP_OLD % self.EQUIP_VALID)
     valid_response(response)
     content = valid_content(response, self.XML_KEY)
     from_db = Interface.objects.filter(equipamento=self.EQUIP_VALID)
     assert len(content) == len(from_db)
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:7,代码来源:test_Interface.py


示例4: test_alter_valid

 def test_alter_valid(self):
     mock = self.mock_network_alter_valid()
     response = self.client_autenticado().postXML(
         self.URL_ALTER, {self.XML_KEY_ALTER: mock})
     valid_response(response)
     net = NetworkIPv4.get_by_pk(self.ID_NETWORK_IPV4_ALTER_VALID)
     self.valid_network_attr(mock, model_to_dict(net))
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:7,代码来源:test_Network.py


示例5: test_alter_valid

 def test_alter_valid(self):
     mock = self.mock_valid_alter()
     response = self.client_autenticado().postXML(
         self.URL_ALTER, {self.XML_KEY: mock})
     valid_response(response)
     tpa = EquipamentoAcesso.get_by_pk(self.ID_ALTER_VALID)
     self.valid_attr(mock, model_to_dict(tpa))
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:7,代码来源:test_EquipmentAccess.py


示例6: 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


示例7: 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


示例8: test_alter_valid

    def test_alter_valid(self):
        mock = self.mock_valid_alter()
        response = self.alter(self.ID_ALTER_VALID, {self.XML_KEY: mock})
        valid_response(response)

        nt = TipoRede.get_by_pk(self.ID_ALTER_VALID)
        self.valid_attr(mock, model_to_dict(nt))
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:7,代码来源:test_NetType.py


示例9: test_authenticate_wrong_password

 def test_authenticate_wrong_password(self):
     mock = self.user_login_valid()
     mock['password'] = string_generator(10)
     response = self.client_autenticado().postXML(
         self.URL_AUTHENTICATE, {self.XML_KEY: mock})
     valid_response(response)
     assert xml2dict(response.content) == None
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:7,代码来源:test_User.py


示例10: test_get_by_equipment_no_read_permission

    def test_get_by_equipment_no_read_permission(self):
        equip_access_map = dict()
        equip_access_map['name'] = self.EQUIPMENT_NAME_VALID

        response = self.client_no_read_permission().postXML(
            self.URL_GET_BY_EQUIP_NAME, {self.XML_KEY: equip_access_map})
        valid_response(response, httplib.PAYMENT_REQUIRED)
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:7,代码来源:test_EquipmentAccess.py


示例11: test_get_by_equipment

 def test_get_by_equipment(self):
     response = self.client_autenticado().get(
         self.URL_GET_BY_EQUIP % self.ID_EQUIPMENT_VALID)
     valid_response(response)
     content = valid_content(response, self.XML_KEY, True)
     query = Q(equipamentoambiente__equipamento=self.ID_EQUIPMENT_VALID)
     valid_get_filtered(content, Ambiente, query)
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:7,代码来源:test_Environment.py


示例12: test_get_by_env_vip_valid

 def test_get_by_env_vip_valid(self):
     response = self.get_by_env_vip(self.ID_ENV_VIP_VALID)
     valid_response(response)
     content = valid_content(response, self.XML_KEY)
     assert len(content) == len(
         self.OBJ.objects.select_related().filter(optionvipenvironmentvip__environment=self.ID_ENV_VIP_VALID)
     )
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:7,代码来源:test_OptionVIP.py


示例13: test_change_pass_maxsize

 def test_change_pass_maxsize(self):
     data = self.user_change_pass_valid()
     data['password'] = string_generator(46)
     response = self.client_autenticado().postXML(
         self.URL_CHANGE_PASS, {self.XML_KEY: data})
     valid_response(response, status_code=httplib.INTERNAL_SERVER_ERROR)
     self._attr_invalid(response)
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:7,代码来源:test_User.py


示例14: test_authenticate_none_password

 def test_authenticate_none_password(self):
     mock = self.user_login_valid()
     mock['password'] = None
     response = self.client_autenticado().postXML(
         self.URL_AUTHENTICATE, {self.XML_KEY: mock})
     valid_response(response, status_code=httplib.INTERNAL_SERVER_ERROR)
     self._attr_invalid(response)
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:7,代码来源:test_User.py


示例15: test_authenticate_empty_username

 def test_authenticate_empty_username(self):
     mock = self.user_login_valid()
     mock['username'] = ''
     response = self.client_autenticado().postXML(
         self.URL_AUTHENTICATE, {self.XML_KEY: mock})
     valid_response(response, status_code=httplib.INTERNAL_SERVER_ERROR)
     self._attr_invalid(response)
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:7,代码来源:test_User.py


示例16: test_alter_valid

 def test_alter_valid(self):
     mock = self.mock_valid_alter()
     response = self.alter(self.ID_ALTER_VALID, {self.XML_KEY: mock})
     valid_response(response)
     equip_group_right = DireitosGrupoEquipamento.get_by_pk(
         self.ID_ALTER_VALID)
     self.valid_attr(mock, model_to_dict(equip_group_right))
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:7,代码来源:test_EquipmentGroupRights.py


示例17: test_save_valid

 def test_save_valid(self):
     mock = self.mock_valid()
     response = self.save({self.XML_KEY: mock})
     valid_response(response)
     equipment_type = valid_content(response, self.XML_KEY)
     from_db = EquipamentoAmbiente.objects.get(
         equipamento=self.ID_EQUIPMENT_VALID, ambiente=self.ID_ENVIRONMENT_VALID)
     assert str(from_db.id) == str(equipment_type['id'])
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:8,代码来源:test_EquipmentEnvironment.py


示例18: test_get_vips_by_env_id_valid

 def test_get_vips_by_env_id_valid(self):
     response = self.client_autenticado().get(self.URL_GET_VIPS_FROM_ENV_VIP % self.ID_VALID_VIPS_ASSOCIATION)
     valid_response(response)
     content = valid_content(response)
     query = Q(ip__networkipv4__ambient_vip__id=self.ID_VALID_VIPS_ASSOCIATION) | Q(
         ipv6__networkipv6__ambient_vip__id=self.ID_VALID_VIPS_ASSOCIATION
     )
     valid_get_filtered(content, RequisicaoVips, query)
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:8,代码来源:test_EnvironmentVIP.py


示例19: test_get_by_equipment

    def test_get_by_equipment(self):
        response = self.client_autenticado().get(
            self.URL_GET_EQUIPMENT % self.ID_VALID)
        valid_response(response)
        content = valid_content(response, "script", True)

        query = Q(equipamento__id=self.ID_VALID)
        valid_get_filtered(content, EquipamentoRoteiro, query)
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:8,代码来源:test_Script.py


示例20: test_get_by_script_type

    def test_get_by_script_type(self):
        response = self.client_autenticado().get(
            self.URL_GET_SCRIPT_TYPE % self.ID_VALID)
        valid_response(response)
        content = valid_content(response, "script", True)

        query = Q(tipo_roteiro__id=self.ID_VALID)
        valid_get_filtered(content, self.OBJ, query)
开发者ID:itnihao,项目名称:GloboNetworkAPI,代码行数:8,代码来源:test_Script.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python util.is_valid_int_greater_zero_param函数代码示例发布时间:2022-05-27
下一篇:
Python functions.valid_content函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap